PDF 7.5 stamping sometimes doubles the file size

PDF 7.5 fixed several outstanding errors for me, but I have found what appears to be a new one.

When I stamp some PDF files, the stamped output file is about twice as large as the input.

In some instances the files that this happens to appear to be the same files that were throwing errors in 7.1 that I reported and were filed as PDFNEWNET-34301

I am uploading an example of an input and output PDF.

Thanks

Steve

Hi Steve,


Thanks for using our products.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34608. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.

PS, As per my observations, the output file is 756KB when I have used the following code snippet.


[C#]

//open document<o:p></o:p>

Document pdfDocument = new Document("c:/pdftest/input.pdf");

//create text stamp

TextStamp textStamp = new TextStamp("Sample Stamp");

//set whether stamp is background

textStamp.Background = true;

//set origin

textStamp.XIndent = 100;

textStamp.YIndent = 100;

//rotate stamp

textStamp.Rotate = Rotation.on90;

//set text properties

textStamp.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont("Arial");

textStamp.TextState.FontSize = 14.0F;

textStamp.TextState.FontStyle = Aspose.Pdf.Text.FontStyles.Bold;

textStamp.TextState.FontStyle = Aspose.Pdf.Text.FontStyles.Italic;

textStamp.TextState.ForegroundColor = System.Drawing.Color.Aqua;

//add stamp to particular page

pdfDocument.Pages[1].AddStamp(textStamp);

//save output document

pdfDocument.Save("c:/pdftest/Stampped_output.pdf");

Hi Steve,


Thanks for your patience.

We have further investigated the issue reported earlier and have found that page of the document has specific structure (large page contents, placed in array) which does not allow to remove unnecessary information after page update (to do this we need to review all document structure which may be too slow in some cases - see also in previous comments). To decrease size of the document customer may call pdfDocument.OptimizeResources() method before saving which will remove unnecessary information. When OptimizeResources() method is called the output file size if ~500К.

The issues you have found earlier (filed as PDFNEWNET-34608) have been fixed in Aspose.Pdf for .NET 7.7.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.