This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes How insert page footer in pdf when copy the pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How insert page footer in pdf when copy the pdf" Watch "How insert page footer in pdf when copy the pdf" New topic
Author

How insert page footer in pdf when copy the pdf

changping shui
Greenhorn

Joined: Dec 20, 2006
Posts: 3
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
Which API is this that you're using? What does the code do now, and what's still missing?


Ping & DNS - updated with new look and Ping home screen widget
changping shui
Greenhorn

Joined: Dec 20, 2006
Posts: 3
now. I'm using the iText 2.1.7



changping shui
Greenhorn

Joined: Dec 20, 2006
Posts: 3


I try to add the footer as the first post, but there is no affection.

and I look at the example in iText in Action.
There is in_action.chapter18.HelloWorldStream class
so I follow it, and modify the code like above, it also no affection
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
I don't think you can use HeaderFooter when altering an existing document - you need to work with lower-level classes. I also think that PdfStamper is a better choice than PdfCopy.

Here's an example that adds text to an existing document: http://1t3xt.info/examples/browse/?page=example&id=24 (that would be in the "getOverContent" part). Instead of setTextMatrix and showText you may want to use "over.showTextAligned(PdfContentByte.ALIGN_RIGHT, text, x, y, 0)" with suitable values for x and y (which will depend on the page size).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How insert page footer in pdf when copy the pdf
 
Similar Threads
missing line space in Text field while merging multiple PDF's using PDFCopy of IText
iText: password protect a signed pdf file
Adding Header and Footer to an existing PDF
Covert a PDF to PDF/A format using iText
Unable to Print more than 1 File