Robert Spielmann wrote:
> Hi all,
>
> I'm adding a JPG to a page using the stamper like this:
>
> // Load the arrow
> Image pfeil = Image.getInstance("templates/Pfeil_schwarz_oben.jpg");
>
> // Scale the arrow (the template PDF has 300 dpi)
> pfeil.scalePercent(((float)pfeil.getDpiX()/300)*100);
>
> pfeil.setAbsolutePosition(calculated coordinates);
> over.addImage(pfeil);
OK.
> Then I perform over.endText();
Why? Did you add any text?
Do you have an over.beginText() anywhere?
> and continue with stamping operations for the next template pages.
So maybe you have text, maybe you haven't.
You aren't telling us.
If you haven't, drop the endText();
if you have: are all the beginText() and endText() operations
in balance?
> As soon as I open the resulting PDF file in Acrobat Reader (v8.1.2),
> it tells me the usual cryptic "An error exists on this page." etc.
That's not cryptic to us if you indeed have an ET without a BT.
That's an error in your PDF syntax.
> Foxit Reader says nothing,
Because Foxit is sloppy.
> and btw Acrobat Reader DOES display the page correctly.
Because Adobe did an effort to overcome the syntax error.
(It's not fatal, but you should correct it.)
> However, I'd like to get rid of this error popup.
Correct the syntax error.
> What should I do? Might I have made some kind of mistake adding the image
> this way?
If you're only adding an image and no text, drop the endText().
(Why did you put it there in the first place?)
br,
Bruno
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar