i have try create a pdf with 10 page based on same template having dimension 20Kbyte.
the total size of file is 200Kbyte.
there is a way for save one time template in PDF file e reuse for differente page ?
thanks
ivan
Reuse Template in PDF
Re: Reuse Template in PDF
Support · Feb 8, 2006Ivan, in general, if you are going to reuse a PDF document in your application you will want to define that PDF as a "PdfDocument" object and then reuse that "PdfDocumnet" when needed (as opposed to using the file path to the file each time).
Anytime a "PdfDocument" is used as a template more than once all the resources of that PDF (images, fonts, etc.) will then be shared and not added multiple times. This can greatly improve the performance of the application as well as the overall size of the final output PDF.
From what you described below it sounds likely you are not using this "PdfDocument". Take a look at our Performance Considerations
page of our Help Documentation for Merger. This page explains this concept in more detail as well as gives a simple example.
Thanks,
ceTe Software Support Team
Re: Reuse Template in PDF
Forum member · Feb 9, 2006this is my code:
MergeDocument objDocument = new MergeDocument();
ImportedPage ip1 = new ImportedPage(@"C:\PAGE1.PDF",1);
ImportedPage ip2 = new ImportedPage(@"C:\PAGE2.PDF",1);
for (int x=0; x<100; x++)
{
objDocument.Pages.Add(ip1);
objDocument.Pages.Add(ip2);
}
objDocument.Draw( @"C:\MyDoc.pdf" );
Page1.PDF is 26K
Page2.PDF is 28K
this example write 200 page (100 page1 and 100 page2) and the destination file size is 2.363 KB
there is a way for include Page1.PDF data and Page2.PDF data one time in destination file, and reduce file size near 54KB ??
thanks
Ivan
Re: Reuse Template in PDF
Support · Feb 9, 2006Ivan, the code that you sent over looks good. I would then like to check two other things that could be causing the size of the file to increase so significantly.
First, what version of our Merger product are you using? Our latest version 3.0.3 of Merger is going to give you the smallest file sizes. In this version, all of the resources for pages added with the same templates will be reused. In previous versions some but not necessarily all the resources would be shared. Make sure to get the latest version 3.0 to see this.
Second, is the product you are using licensed or are you still evaluating? The evaluation watermark will actually add some size overhead to each page that could grow significant over many pages. If you would like to receive a temporary evaluation license to remove the watermark for testing more precise file sizes you can send an email to [^a|mailto:support@cete.com|Support^] requesting this.
Thanks,
ceTe Software Support Team
Re: Reuse Template in PDF
Forum member · Feb 9, 2006i use a licensed "DynamicPDF Merger.NET Enterprise Developer Edition" version 1.0.3.0 and the output is without watermark.
if the new version reduce the file size, i buy upgrade.
how to test the example code posted with a version 3.0 without watermark?
i send mail to support@cete.com with my email address and Page1.pdf and Page2.pdf used with test.
thanks
ivan