Dear all, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I would like to add some attachments to an existing pdf file. How can I achieve this b< 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,
Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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 can understand your concern. I would like to share with you 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 the documents are accessible by Aspose staff only.
Nevertheless, if you still don’t feel like sharing the documents, can you please share the following information with us so we could reproduce the issue at our end?
1. The size of the original PDF document 2. The number of the files attached to the document 3. The type of the files being attached 4. Size of the individual files to be attached
We’ll try to test the issue at our end and update you accordingly.
Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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.
Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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 youe 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,
Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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,
Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Sorry. I can’t agree that the mentioned issue is fixed. It takes more then 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)