On 17/09/2010 10:43, Pierre-Nicolas Lemoine wrote:
> I used, as you said, the PdfCopy class and the merging
> is okay.

OK, that's one problem out of the way. Depending on the nature of the 
documents you are merging, you may want to use PdfSmartCopy instead of 
PdfCopy, but that's explained in chapter 6 too.

> For the pagination, I saw that it's no possible by the PdfCopy.

Where did you see that? If you have read chapter 6, you have overlooked 
this part (copy/paste from the ebook):

ADDING CONTENT WITH PDFCOPY
In previous sections, I explained that PdfImportedPage is a read-only 
subclass of PdfTemplate. You can't add any content to an imported page. 
This wasn't a big deal when using imported pages with PdfWriter and 
PdfStamper because we could easily add content over or under the 
imported page. When using PdfCopy, it would be interesting if we could 
somehow add extra content too.
For instance, it would be interesting if we could add a "page X of Y" 
footer that reflects the new page numbers. Listing 6.22 shows how to 
achieve this.

> Is there an way to do it ?

Yes, and listing 6.22 shows how.

> Hack the stream after ?

No, certainly not! Too error prone as a solution.

> Or recreate a reader and put pagination ?

That's another option explained in chapter 6.
You could create the merged PDF in memory first, and then add page 
numbers with PdfStamper. The best solution depends on the nature of the 
documents.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to