SALERNI ACHILLE wrote:

I need to put in each page of my Pdf a text as background, using getUnderContent, I read in archive that Illegal operation 'Tm' outside a text object is generated by a wrong position in code but I don't understand where I have to put it, because I don't have direct call to beginText and endText() .

you are using showTextAligned,
this method needs to be inside a BeginText/EndText sequence:

<> PdfContentByte under = writer.getDirectContentUnder();
/under.setColorFill(new Color(220, 220, 220));
/

under.beginText();

/under.setFontAndSize(bf, 36);
under.showTextAligned(Element.ALIGN_LEFT, "TEXT", 50, 50, 55);
/

under.endText();

Tm is a 'move' operation in Text State.
It is used behind the scene by showTextAligned.
It may only be used in a BT/ET sequence.

Note that the following line is not necessary:

/under.fill();/

br,
Bruno


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to