Ejemplo n.º 1
0
        public static void Run()
        {
            // ExStart:1
            WordsApi   wordsApi   = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "SampleWordDocument.docx";

            String storage = null;
            String folder  = null;


            try
            {
                // Upload the file
                storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
                // Invoke Aspose.Words Cloud SDK API to get bookmarks from document by name
                BookmarkResponse apiResponse = wordsApi.PostUpdateDocumentBookmark(fileName, "test", "", storage, folder, null);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Bookmark updated.");

                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
 public void Pdf_Bookmarks_Tests()
 {
     try
     {
         BookmarksResponse bookmarksResponse = pdfService.Bookmarks.ReadAllDocumentBookmarks("pdf-sample.pdf", Utils.CloudStorage_Input_Folder);
         BookmarkResponse  bookmarkResponse  = pdfService.Bookmarks.ReadDocumentBookmark("pdf-sample.pdf", 1, Utils.CloudStorage_Input_Folder);
     }
     catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateBookmarkOnlineResponse"/> class.
 /// </summary>
 /// <param name="model">The response model.</param>
 /// <param name="document">The document after modification.</param>
 public UpdateBookmarkOnlineResponse(BookmarkResponse model, System.IO.Stream document)
 {
     this.Model    = model;
     this.Document = document;
 }