Hello. I'm having an issue with putting on image on a multiple-page PDF. Here
is a code snippet. I am using iText with ColdFusion.
<cfscript>
readPDF = "\\srv-intranet\stcnet1\stcirc\webforms\ccforms\Dispute Form.pdf";
writePDF = "\\srv-intranet\stcnet1\stcirc\webforms\ccforms\Dispute
Form_output.pdf";
yourimage = "#application.ccsigs##get_form.sig_image#";
fileIO = createObject("java","java.io.FileOutputStream").init(writePDF);
reader = createObject("java","com.lowagie.text.pdf.PdfReader").init(readPDF);
stamper =
createObject("java","com.lowagie.text.pdf.PdfStamper").init(reader, fileIO);
content = stamper.getOverContent(reader.getNumberOfPages());
image = createobject("java", "com.lowagie.text.Image");
pdfForm = stamper.getAcroFields();
pdfForm.setField("name", "#get_form.FirstName# #get_form.LastName#");
|
|
img = image.getInstance(yourimage);
img.setTransparency(trans);
img.setAbsolutePosition(120, 750);
content.addImage(img);
stamper.setFormFlattening(true);
stamper.close();
reader.close();
</cfscript>
I need the image to be placed on the *first* page of the PDF. The
img.setAbsolutePosition(x,y) seems to only place it somewhere on the second
page. I'm not quite sure how to get around this. It's probably simple,
something I'm overlooking, but any help would be appreciated.
DISCLAIMER:This email may contain confidential information intended solely for
the person(s) it is addressed to. Unauthorized viewing, modification, or
interception of this communication is forbidden. If you have received this
message in error please notify the sender immediately.
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php