bruno <bruno <at> lowagie.com> writes:

> Without seeing the image/PDF, there's little we can do.
> There are too many unknown parameters for us to know what went wrong.
> For instance: how did you define the rectangle?
> Did you change the Graphics State before adding the image?
> br,
> Bruno
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> 

Really, I have an AcroForm based on a pdf.
After complete the AcroForm, I want to add the image at an absolute position 
(inside a square) at the page 6 of the document.
I post the code, to avoid misunderstandings.

-------------------
String plantillaBase = "C:/plantillas/plantilla.pdf; 
FdfWriter fdf = new FdfWriter();
fdf.setFieldAsString("Texto1", "Example text");
fdf.setFile(plantillaBase);

fdf.writeTo(new FileOutputStream("temp.fdf"));

PdfReader reader = new PdfReader(plantillaBase);
PdfStamper stamper = new PdfStamper(reader,new FileOutputStream("Result.pdf"));
FdfReader fdfForms = new FdfReader("temp.fdf");
AcroFields form = stamper.getAcroFields();
form.setFields(fdfForms);

stamper.setFormFlattening(true);

Image imagenMarca = Image.getInstance("C:/imgs/image1.jpg");
imagenMarca.scaleAbsolute(8f / 2.54f * 72f, 12f / 2.54f * 72f);
imagenMarca.setAbsolutePosition(100,200);

PdfContentByte contentByte = stamper.getOverContent(6);

contentByte.addImage(imagenMarca);

stamper.close();

---------------------

The resulting image in the pdf is not 8 x 12 cm.

Thanks,




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to