Prepend a page to an existing document

Last post 08-03-2011, 3:00 PM by alexey.noskov. 3 replies.
Sort Posts: Previous Next
  •  08-02-2011, 5:40 PM 320119

    Prepend a page to an existing document .NET

    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?

    Thanks!
     
  •  08-02-2011, 8:33 PM 320129 in reply to 320119

    Re: Prepend a 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.

    Thanks,

    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  08-03-2011, 10:22 AM 320303 in reply to 320129

    Re: Prepend a page to an existing document .NET

    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!

     
  •  08-03-2011, 3:00 PM 320366 in reply to 320303

    Re: Prepend a page to an existing document

    Hi

     

    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,


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML