I am trying to annotate images in the PdfContentByte area of the PDF
document. The annotation appears to add when I set it:
public void imageURL(Image urlimage, String url) {
// Left
// Check if image provided
boolean urlnotblank = StringUtils.isNotBlank(url.trim());
// Image provided
if (urlnotblank == true) {
urlimage.setAnnotation(new Annotation(0, 0, 0,
0,
"http://www.lowagie.com/iText"));
}
}
...and the image is added to the document without an error
public void PDFImage(Document document, Vector imgvector,
PdfContentByte cb, PdfContentByte cbu) {
try {
// Create new instance
iPDFImage img = new iPDFImage();
// Initialise counter
int x = 0;
for (int i = 0; i < imgvector.size(); i++) {
// Retrieve vector object
img = (iPDFImage) imgvector.get(i);
// Set position
img.pdfimage.setAbsolutePosition(Float.valueOf(img.getImageX().trim()).floatValue(),
document.getPageSize().getHeight() -
Float.valueOf(img.getImageY().trim()).floatValue());
// Add image
if (img.getUnder().equals(Yes)) {
cbu.addImage(img.pdfimage);
}
else {
cb.addImage(img.pdfimage);
}
// Increment vector element
x = x + 1;
}
}
catch(Exception e) {
throw new ExceptionConverter(e);
}
}
...but then an exception occurs when I close the document. No additional
error information is provided.
Is this the correct method for annotating images in the contentbyte area of
the document. This error only occurs when I try and annotate an image -
otherwise the doument assembles correctly.
Thanks
Paul
--
View this message in context:
http://www.nabble.com/Image-Annotation-on-PdfContentByte-tp23835644p23835644.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/