Hello.
I want to use one PDF File (cover.pdf) as background for another PDF
file (created by the function createTitle I have written) and use
PdfStamper for this task.
When I use an image (jpg) instead of cover.pdf I can create a Pdf File
that can be displayed without problems within Acrobat 7.
When I use cover.pdf and try to wrap it into an Image Object, Acrobat
gives the error message "There was an error processing a page. There was
a problem reading this document."
kpdf displays the page without the background, giving the error message
XtUngrabButton(drawArea,3,0)
This is the code I use:
public static File getComponent(BaseFont stdTextFont, BaseFont
stdExtraFont, File pageTemplate) {
Image templateImage = Image.getInstance("/tmp/cover.pdf");
templateImage.setAbsolutePosition(200,400);
File contentFile = createTitle(stdTextFont, stdExtraFont);
PdfReader templateReader = new PdfReader(contentFile.toString());
File pdfTempFile = File.createTempFile("pdf-title-", ".pdf");
FileOutputStream fos = new FileOutputStream(pdfTempFile);
PdfStamper stamper = new PdfStamper(templateReader,fos);
PdfContentByte under = stamper.getUnderContent(1);
under.addImage(templateImage);
stamper.setFormFlattening(true);
stamper.setRotateContents(false);
stamper.close();
}
What am I doing wrong?
Best regards,
Joern
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/