This isn't a trivial piece of code.
* You need to understand the PDF internals enough to start looking at what
Acrobat writes out for Stamps
* Figure out how to identify your stamp from other stamps (based on data in
the appropriate object)
* Write the code to walk all Stamps in the PDF (that's actually pretty much
already there in iText)
* Locate yours
* Remove it
* Put something else there.
Leonard
From: Wyatt Biker <[email protected]<mailto:[email protected]>>
Reply-To: Post here
<[email protected]<mailto:[email protected]>>
Date: Wed, 7 Sep 2011 08:05:20 -0700
To: Post here
<[email protected]<mailto:[email protected]>>
Subject: [iText-questions] How do I find a stamped image to replace it with
another?
I create a PDF with Acrobat. I added an image using Tools/Comment Markup/Stamps
a custom stamped a blank placeholder jpg, gave it category and name and resized
it and positioned on the PDF.
I found code in the iText in Action book to create an Image object and add it
at a set coordinate to the stamper. My question is how do I programmatically
locate the object and hence its coordinates (ie the bounding box)?
Here is the example but missing how to get bounding box info of the existing
image.
PdfReader pdfi=new PdfReader(filein);
PdfStamper stamper=new PdfStamper(pdfi,new FileOutputStream(fileout));
PdfContentByte canvas = stamper.getOverContent(1);
///.... I need code here to find and get bounding info of the place holder
stamped image made in Acrobat..........
img = Image.getInstance(String.format(RESOURCE));
img.scaleToFit(width,height);
img.setAbsolutePosition(x,y);
canvas.addImage(img);
Thanks
------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
iText-questions mailing list
[email protected]
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