Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] using letterhead

Bear Giles

2006-07-20

Replies:

I'm sure this is straightforward but this has totally stumped me.

I can create a blank document with

 Document doc = new Document(PageSize.LETTER);
 ....
 doc.setMargins();
 doc.open();
 doc.add()....
 doc.close();

and everything works. But I need to push the content onto existing
letterhead, not a blank document. I've tried using

 PdfStamper stamper = new PdfStamper(InputStream containing letterhead
PDF)
 Document doc = stamper.getOverContent(1).getPdfDocument();
 ...
 doc.setMargins()?;
 doc.add()...
 stamper.close();

(no 'doc.open()' or 'doc.close()'). The 'add()' calls succeed, but the
resulting document only contains the original letterhead. No text.

Am I chasing the wrong trail? I noticed PdfTemplate, but didn't see how
it would apply in this case.

Thanks,

Bear

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.