public static void Run()
        {
            // ExStart:1
            PdfApi     pdfApi     = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "Sample-Bookmark.pdf";
            String storage  = "";
            String folder   = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.PDF Cloud SDK API to get all bookmarks from pdf
                BookmarksResponse apiResponse = pdfApi.GetDocumentBookmarks(fileName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Com.Aspose.PDF.Model.Bookmarks bookmarks = apiResponse.Bookmarks;
                    Console.WriteLine("Get all Bookmarks from a PDF,Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public void GetDocumentBookmarksTest()
        {
            const string name = "PdfWithBookmarks.pdf";

            UploadFile(name, name);

            var response = PdfApi.GetDocumentBookmarks(name, folder: TempFolder);

            Assert.That(response.Code, Is.EqualTo(200));
        }
        public void GetDocumentBookmarksTest()
        {
            const string name = "PdfWithBookmarks.pdf";

            UploadFile(name, name);

            var response = api.GetDocumentBookmarks(name, folder: FolderName);

            Console.WriteLine(response);
        }
Esempio n. 4
0
        public void GetDocumentBookmarksExample()
        {
            //ExStart: GetDocumentBookmarksExample
            const string name = "PdfWithBookmarks.pdf";

            UploadFile(name, name);

            var response = api.GetDocumentBookmarks(name, folder: FolderName);

            Console.WriteLine(response);
            //ExEnd: GetDocumentBookmarksExample
        }