We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDF Size

Hi,

i've created a PdfDocument and inserted in it many pages and many objects.

So i have created a second PdfDocument and the goal is to insert the same pages of the first PdfDocument. I've iterated the pages of the first PdfDocument, call the method CreateTemplate for every page and than draw the template in the second PdfDocument.

After all I saved the two PdfDocument on disk.

The result is that the second Pdf is larger than first...why?


regards,
Stefano


4 Replies

PJ Priyadharshini J Syncfusion Team January 24, 2011 09:45 AM UTC

Hi Stefano,

Thank you for the details.

We could see the issue and this is due to the reason, all created pdf documents will have their own contents, here the contents of a pdf document is made as resources for another pdf document by creating a template. Hence along with the contents already present the resources added from the first document makes the second pdf document larger in size.

I have placed a sample for the same in the location below:
Forum979741883757016.zip

Kindly try this and let us know if you have any queries.

Regards,
Priyadharshini.




EE Enrica EANDI January 25, 2011 08:06 AM UTC

Hi Priyadharshini,

Thank you for your reply.

I've understand what you said but how can i resolve my problem? Have you any ideas?

I need to copy pages from a PdfDocument to another and I need that it is fast and the file size is very similar to the source. It is possible? What is the best mode? Using ImportPageRange method in PdfDocument (is it better than CreateTemplate?) ?


Thanks.

Regards,
Stefano



EE Enrica EANDI January 25, 2011 09:09 AM UTC

Hi Priyadharshini,

i tried to use ImportPageRange but the result is very similar: the file size is larger.



Regards,
Stefano



SP Selvakumar P Syncfusion Team January 26, 2011 05:10 AM UTC

Hi Stefano,

Thanks for the update.

Both the template creation and the ImportPageRange method does the function of copying contents from one document to another document.
While copying contents, we do a lot of transformations with graphical objects such as text, images etc... This makes the second document slightly larger than the first document.

Regards,
Selvakumar.


Loader.
Live Chat Icon For mobile
Up arrow icon