File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Uses-Cases/Attachments/get Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ class Config:
13
13
CREDENTIALS_FILE = Path (r"C:\\Projects\\ASPOSE\\Pdf.Cloud\\Credentials\\credentials.json" )
14
14
LOCAL_FOLDER = Path (r"C:\Samples" )
15
15
PDF_DOCUMENT_NAME = "sample_file_with_attachment.pdf"
16
- LOCAL_RESULT_DOCUMENT_NAME = "output_sample.pdf"
17
- ATTACHMENT_PATH = "/1"
16
+ ATTACHMENT_PATH = ""
18
17
19
18
class PdfAttachments :
20
19
"""Class for managing PDF attachments using Aspose PDF Cloud API."""
@@ -62,6 +61,7 @@ def get_attachments(self):
62
61
response : AttachmentsResponse = self .pdf_api .get_document_attachments (Config .PDF_DOCUMENT_NAME )
63
62
if response .code == 200 :
64
63
logging .info (f"get_attachmnets(): attachments '{ response .attachments } ' for the document '{ Config .PDF_DOCUMENT_NAME } '." )
64
+ Config .ATTACHMENT_PATH = response .attachments .list [0 ].links [0 ].href ;
65
65
else :
66
66
logging .error (f"get_attachmnets(): Failed to get attachments to the document. Response code: { response .code } " )
67
67
except Exception as e :
@@ -90,4 +90,4 @@ def get_attachment_by_id(self):
90
90
pdf_attachments = PdfAttachments ()
91
91
pdf_attachments .upload_document ()
92
92
pdf_attachments .get_attachments ()
93
- pdf_attachments .get_attachment_by_id ()
93
+ pdf_attachments .get_attachment_by_id ()
You can’t perform that action at this time.
0 commit comments