We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Merge from content into a pdf page


I’m stamping existing PDF pages with PdfPageStamp. It produces XForm with stamp. Is there a way to reintegrate/merge stamp content into a page? When this stamp is left in XForm form it slow downs further processing with 3rd part tools for large pdf files.

Jacek Bator

Hi there,

Thanks for your inquiry. Our support team will review this inquiry shortly and get back to you as soon as possible. Please hold tight.


Hi Jacek Bator,

Thanks for using our API.

From your above description, do you mean that when PDF form is stamped using Aspose.Pdf API, the form processing is slowed down on 3rd party application ? Can you please share some details regarding the operation you are performing on 3rd party application ?

Any additional details/resource files which can help us in replicating this issue at our end will really help us in reproducing and further investigating this problem. We are sorry for this inconvenience.

Hello codewarior,

Some times I have to deal with huge amount of pdf data (output file can have 30000-130000 pages). Part of the process is I’m merging large amount of PDF files (over 200) then I’m adding outlines, annotations. Next step is page stamping. I’m stamping each page of output file with PdfPageStamp. Pdf stamp is prepared from Word Doc file with use of Aspose.Words. Fonts are not embeded in output stamp file. Then after stamping I have to convert output file to Pdf 1.4 version and embed the fonts (for ex. keeping ArialMT inside, without substituting it to Helvetica).

Mostly this last step is problematic with Aspose.Pdf thats why I’m using GhostScript for it. There are two problems with Aspose.PDF for that:
  1. Output file size. For example where GS produces 100MB output file Aspose.Pdf produces 1GB output file. Files are simple. Just text inside and no graphics.
  2. OutOfMemory exception. Large files sometimes rise this exceptions on 16 GB machine.
GS handles better this step with one exception. At cost of lower output size and memory usage it works much slower.
Most evident problem is after output pdf file is stamped. In some cases GS runs more then 3-10x slower after file was stamped. But it’s not such simple and obvious.
I have tried to run GS conversion just after files where merged, stamp with Aspose.Pdf and then run again GS conversion to embed fonts and lower output size. It’s illogical but running it twice was faster than running it once after output was stamped.
Basically GS works slightly different way than Aspose.Pdf because it reinterprets Pdf file and writes it’s own/cleaner version. So I thought that simplifying file internal structure would benefit performance.

Hi Jacek,

Thanks for sharing the details. Please optimize your final PDF after/before stamping. Hopefully it will help you to overcome the size and memory issues. Please also use latest version of Aspose.Pdf for .NET. If issue persist then please share your sample PDF file(merged, without stamp) and stamping code, we will test the scenario at our end and provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi Jacek,

Thanks for sharing the details and sorry for the delayed response.

As per my understanding, you are facing an issue while embedding fonts inside PDF file (generated with Aspose.Pdf, once PDF file is added as stamp) and GhostScript is taking too much time. Please note that once you have merged and stamped PDF files, you can optimize the document size by using Aspose.Pdf for .NET. For further details, please visit Optimize PDF file size.

Now concerning to embedding font inside PDF file, you may consider replacing current font inside PDF with particular font. For further details, please visit Replace fonts in existing PDF file.

In case you still face any issue, please share the sample PDF files and code snippet which you are using, so that we can test the scenario at our end.

PS, we can only fix issues pertaining to our API.

Thank you for the tipses.

Unfortunately they are pontless in my case.

1. As I wrote there is no images in my files so images oprimization will not change output file size.
2. I’m not allowed to alter fonts author have chosen for documents. Basically one of our problems with Aspose.Pdf only approach was OutOfMemory exceptions while stamping, embedding fonts and saving results.

Jacek Bator
2. I'm not allowed to alter fonts author have chosen for documents. Basically one of our problems with Aspose.Pdf only approach was OutOfMemory exceptions while stamping, embedding fonts and saving results.
Hi Jacek,

In order to introduces fixes in our API related to above stated scenario, first we need to replicate the problem in our environment so that we can figure out the reasons of this issue. As requested earlier, please share some sample application and resource files which can help us in replicating the OutOfMemory issue. We are sorry for this inconvenience.