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

Free Support Forum - aspose.com

Prepend a page to an existing document

Looking for the best approach to tackle a potentially thorny issue. I’ve got a set of pre-generated documents that I need to insert a customized title page when someone downloads one from my site. These docs are generated ahead of time because they are huge so generating them upon request isn’t really practical.

Is there a way to create a new single page document and quickly (minimal processing time) add it as the first page to an existing document?


Hi there,

Thanks for your inquiry.

Sure, you can prepend a separate document to a template using Aspose.Words.

Please see the second code example in this article page here. This provides the code to prepend documents and demonstrates how to use it.

If you have any troubles, please feel free to ask for help.


Great! Thank you for the code reference.

The big concern for us is processing time and memory consumption. Can you provide an idea of how these would compare to the creation of the original document? As an example, say we are prepending a single cover page to a 300 page document.



Thanks for your request. Processing time and memory consumption fully depends on your documents and their complexity.

Usually, Aspose.Words needs 10 times more memory than the original document size to build a DOM in the memory. But this depends on input file format and document complexity, as I already mentions.

Processing time also depends on what you will do with documents, if you simply open and save the document, processing will be very fast. But if you need to perform some complex operations like rendering, then processing will take a little longer. For example, Aspose.Words renders about 10 pages per second.

Best regards,