Stamping PDF corrupts the file

Whenever we try to stamp a pdf with the fonts not available in the PDF Document, the document gets corrupted after stamping.

I have tried aspose.pdf version 7.6 and 8.9.

TextStamp stampText = new TextStamp("");
stampText.TextState.Font = Aspose.Pdf.Text.
FontRepository.FindFont("Times New Roman");
stampText.TextState.FontSize = 10;
stampText.Rotate = 0;
/*Indentation here*/
pdfDocument.Pages[1].AddStamp(stampText);

Let me know what I am doing wrong. It corrupts only for some files.

Is there a way I can stamp access the pdf fonts and stamp with those fonts.

Mangala

Hi Mangala,


Thanks for contacting support.

Can you please share some sample PDF document so that we can test the scenario at our end. We are sorry for this inconvenience.

These are a few of the files. I would like to point that when the pdf comes in we dont know what font or format it is. so the solution that will be provided by ASPOSE should be font independent.



Hi Mangala,


Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 9.0.0 and as per my observations, I am unable to notice the problem when stamping LoremIpsum-Arial12pt.pdf and LoremIpsum-TNR12pt.pdf files. However, NullReferenceException is occurring when trying to stamp HelveticaSample1.pdf file. For the sake of correction, I have logged this problem
as PDFNEWNET-36537 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

PS, for your reference, I have attached working PDF files with TextStamp.

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

For further details, you may check this blog post.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.