I would like to add some attachments to an existing pdf file. How can I achieve this by using Aspose.PDF? I read the tutorial where the general attachment process is described. But how can I open an existing pdf file.
You can use Aspose.PDF for .NET to add attachments without annotation. You can also use FileAttachmentAnnotation to add attachment and create annotation to open the file. You can create a link to an external PDF file as well using LinkAnnotation; this method opens a specific page of an external PDF. You can also find the examples on the specified links.
I hope this helps. If you have any further questions or concerns, please do let us know. Regards,
Thanks for your reply. I basically know how to add file attachments. But I’m not quite sure how I should perform this task if I don’t create a new PDF file from scratch. Can you provide me just a little piece of code demonstration how to open an existing PDF file, attach some files, and finally save the modified file?
In Adobe Acrobat, the result should look like the provided attachment.
the code snippet is exactly what I was looking for. If I use it to attach my additional files to the main report, the files size explodes from 1.5 MB up to > 11MB (the size of all attached files together is lesser than 5 MB). If I do the same thing in Adobe Acrobat, the size of the original file grows only by 500 KB. Unfortunately, I can’t provide you my sample files because they contain highly confidential information.
I understand your concern. I would like to let you know that any documents shared with the Aspose staff are kept confidential and used for testing purposes. You can mark the post as private and attach the sample documents so that they are accessible by Aspose staff only.
However, if you still don’t feel like sharing the documents, could you please provide the following information so we can reproduce the issue on our end?
The size of the original PDF document
Number of files attached to the document
Type of the files being attached
Size of the individual files to be attached
We’ll try to test the issue on our end and update you accordingly.
I will try to create some dummy files tomorrow. I’m fully aware that you will keep our information confidential, but I can’t provide the original files to you. Right now I can just answer the second and the third question. I have to attach .xls files. The number of documents varies between one and five. The size of these files and the size of the main report depend on the specific content of each document.
Just one more piece of information. I’m using Aspose.Cells to save an xls file in pdf format. This file is then the input file for the attachment process which results in a large pdf file. If I create the basic pdf file with Adobe.Acrobat instead and perform the same attachment process with Aspose.PDF.Kit, the resulting file has the expected files size.
I’m still working on the example files to clarify the issue.
Please find attached all needed files to reproduce the issue:
Example.xls: basic xls file of the report
reportAspose.xls: final report in xls format
reportAspose.pdf: final report in pdf format without attachments (created with Aspose.cells)
reportAdobe.pdf: final report in pdf format without attachments (created with Adobe Acrobat)
AsposeAttachment: final report with attachments (created with Aspose.Pdf.Kit)
AdobeAttachement: final report with attachments (created with Adobe Acrobat)
XXXX*.xls: required attachments
Code.txt: sample source code
If I use the reportAspose.pdf file as starting point for the attachment process, the whole process is really time consuming. If I use the Adobe file instead, the process is executed within a few seconds.
If you need further information, please let me know.
Thank you very much for your cooperation in helping us reproduce this issue. I have logged this issue as PDFKITNET-14401in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once the issue is resolved.
Our team is looking into this issue, however I’m afraid, I can’t share the ETA at the moment. Please spare us some time so we could get a better understanding of the issue. We’ll update you with the ETA the earliest possible.
We’re sorry for the inconvenience and appreciate your patience. Regards,
Can you give me today an ETA of this feature? It is the last one that we need to completely automate our reporting system. I have to report this date to my chief.
I would like to inform you that, as far as the output file size is concerned, we’ll provide you the resolution in our monthly release due at the end of April; however, we’ll try to provide you a hotfix in the mid of April.
Regarding the time difference between the two files (reportAspose.pdf vs. reportAdobe.pdf), I would like to share that the reportAspose.pdf contains more objects than the reportAdobe.pdf that’s why it is quite natural to take different time to process both of these files. I have contacted Aspose.Cells team to look further into this difference and you’ll be updated accordingly.
If you have any further questions, please do let us know. Regards,
Sorry. I can’t agree that the mentioned issue is fixed. It takes more than 8 minutes to attach 6 Excel files. After attaching the files, the file size explodes from 3 up to 30 MB. Under these circumstances, I can’t use this feature (but I’m in desperate need of it).
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.