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 = "SampleAttachment.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 attachment count from a pdf
                AttachmentsResponse apiResponse = pdfApi.GetDocumentAttachments(fileName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Com.Aspose.PDF.Model.Attachments attachments = apiResponse.Attachments;
                    int count = attachments.List.Count;
                    Console.WriteLine("Count :: " + count);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public void GetDocumentAttachmentsExample()
        {
            //ExStart: GetDocumentAttachmentsExample
            var response = api.GetDocumentAttachments(Name, folder: FolderName);

            Console.WriteLine(response);
            //ExEnd: GetDocumentAttachmentsExample
        }
        public void GetDocumentAttachmentsTest()
        {
            var response = PdfApi.GetDocumentAttachments(Name, folder: TempFolder);

            Assert.That(response.Code, Is.EqualTo(200));
        }
Beispiel #4
0
        public void GetDocumentAttachmentsTest()
        {
            var response = api.GetDocumentAttachments(Name, folder: FolderName);

            Console.WriteLine(response);
        }