Free Support Forum -

Out of memory while stamping PDFs with thousands of pages

The attached PDF has over 8000 pages. This causes Aspose.Pdf 7.1.0 to run out of memory when attempting to place a stamp on each page. In fact I think it runs out of memory while attempting to stamp the first page.

Example code:

PdfFileStamp pdfFileStamp = new PdfFileStamp(pdfFilePath, pdfFilePath, true);

for (int pageIndex = 1; pageIndex <= 8000; pageIndex++)
Page page = pdfFileStamp.Document.Pages[pageIndex];
Stamp stamp = new Stamp();

FormattedText formattedText = new FormattedText("stamp " + pageIndex, System.Drawing.Color.Black, “Helvetica”, EncodingType.Winansi, true, 12);

stamp.SetOrigin(100, 100);

stamp.PageNumber = pageIndex;
stamp.StampId = pageIndex;



Hi Reuben,

Thanks for using our products.

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
will investigate this issue in details and will keep you updated on the status
of a correction.

apologize for your inconvenience.

Hi Reuben,

Thanks for your patience.

I am pleased to share that the issue reported earlier has been resolved and its HotFix will be included in next release version of Aspose.Pdf for .NET 7.4.0, which is planned for early next month (October-2012). Please be patient and wait for the new release version.

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

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