The error is not from here. You have something like this:
cb.beginText();
cb.saveState();
Best Regards,
Paulo Soares
> -----Original Message-----
> From: Arno van der Kolk [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 10:49
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Drawing on Graphics2D produces "Illegal
> operation 'q' inside a text object."
>
> Hello all.
>
> I'm having a slight problem, which I'm hoping any of you might be able to
> explain to me a bit. I have searched on Google and through the mail
> archive, but I can't seem to find any leads...
>
> Here's a small code fragment that produces the error "Illegal operation
> 'q' inside a text object." (obviously, it's an Acrobat Reader error):
>
> //----------------------------------------------------------------------
> int width = 300, height = 20, x = 40, y = 300;
>
> DefaultFontMapper mapper = new DefaultFontMapper();
> mapper.insertDirectory("c:\\winnt\\fonts");
> PdfTemplate tp = contentByte.createTemplate(width, height);
> tp.setWidth(width);
> tp.setHeight(height);
> java.awt.Graphics2D g2 = tp.createGraphics(width, height, mapper);
>
> // draw things to g2
> g2.setColor(java.awt.Color.green);
> g2.fillRect(0, 0, width, height);
> g2.setColor(java.awt.Color.black);
> g2.drawRect(0, 0, width, height);
>
> g2.dispose();
> contentByte.addTemplate(tp, x, pageSize.height() - (y + height));
> //----------------------------------------------------------------------
>
> Here are some remarks:
> * the code should draw a green bar, with a black border
> (position x, y and dimensions width, height)
> * "contentByte" is already available (all of the code compiles)
> * whether or not I supply the "mapper" argument to 'createGraphics'
> doesn't make any difference
> * when I disable the code above entirely, the PDF will work just fine
> (ie, there's more content: watermark, footer, logo, text)
> * disabling all other content-generating code doesn't resolve the problem
> * I'm developing on a NT4 machine
>
> I don't know if any other details are required, if so please ask.
>
> I'd appreciate it if anybody could tell me a bit more about the error
> in the first place. It's too cryptic for me. :(
>
> Thanks
> Arno van der Kolk
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions