Richard Michael wrote: >> If the pages all have the same size, >> and the extra content you're adding looks >> exactly the same for each page, you might >> want to create the 'line numbers' as a >> separate PDF (with Acrobat or iText or...), >> then superimpose this PDF on the existing PDF. > > Thanks. Will it be easy to construct a new PDF and merging the two > documents, instead of merging new content on each page with a > PdfStamper?
Superimposing is also done with PdfStamper. It saves you a lot of CPU and it will result in a PDF with a lower file size, if you reuse the same template for every page. The word 'template' in the above sentence can be interpreted in different ways. You can interpret it as a one page PDF created the way you want it with the tool you find most suited for the job. You will use iText to import this one page ('the template') as a PdfImportedPage, maybe wrap this object in an Image object (with absolute positions set to x=0, y=0), and add it to each page with PdfStamper.getOverContent().addImage(img); Or you can create the template with iText as a PdfTemplate object, use some math, some moveTo, lineTo, showTextAligned methods to create the line numbers and marks, and then maybe also wrap the PdfTemplate object in an image, adding it the same way as I just described. This will avoid duplicate work (drawing the same numbers and mark over and over again for each page) and duplicate data (adding the same content stream as many times to the PDF as there are pages). br, Bruno ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/