Hi all , i want to open a document without create a document object , my
goal is to add an image to a document using PdfStamper to add thios image
over the initial content , bat my problem is that i have some document
witch its opened in 30% or 40 % and when i ad the image it dos not added in
the place wich i want , my code :
String fileOut = null;
String fileOutPath = null;
try {
PdfReader reader = new PdfReader(fileIn);
int n = reader.getNumberOfPages();
if (page <= n && page >0)
{
Rectangle psize = reader.getPageSize(1);
float width = psize.width();
float height = psize.height();
PdfStamper stamper = new PdfStamper(reader, new
FileOutputStream(fileOutPath));
PdfContentByte
overContent=stamper.getOverContent(page);
Image img = Image.getInstance(sign);
img.setAbsolutePosition(posx *( (2 * width) / 9),
posy *( height / 6));
img.scalePercent((100/img.height())*100);
overContent.addImage(img);
stamper.close();
fileOut =
fileOutPath.substring(fileOutPath.lastIndexOf('/')+1,
fileOutPath.length());
}
else
{
setErrorMessage("Page number not valid !<br>");
signPosed = false;
return null;
}
Thanks
*************************************************************************
This message and any attachments (the "message") are confidential and intended
solely for the addressee(s).
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to
alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be
liable for the message if altered, changed or falsified.
************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses
destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout
message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de
ce message s'il a ete altere, deforme ou falsifie.
*************************************************************************
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions