Custom Search

[Top] [All Lists]

Error: Unbalanced begin/end text operators since iText 5

Subject: Error: Unbalanced begin/end text operators since iText 5
Date: Mon, 30 Aug 2010 00:52:21 -0700 (PDT)
When I wanted to use chunk.SetCharacterSpacing(), I realized that it was
about time to update my 4 year old iTextSharp library. Many classes
disappeared and I had to update my code. However I'm still stuck with an
error message which did not show up before, namely
Error: Unbalanced begin/end text operators
The code in question looks like this:
document = new Document();
writer = PdfWriter.GetInstance(document, pdfFile);
cb = writer.DirectContent;
bf = BaseFont.CreateFont(fontfile, BaseFont.WINANSI, true);
font = new Font(bf, size, style);
chunk = new Chunk(contentString, font);
phrase = new Phrase(chunk);
ct = new ColumnText(cb);
ct.SetSimpleColumn(a, b, c, d, e, f);
I'm getting the error after the last statment. I also tried with setting
cb.BeginText() and cb.EndText() at several places but this changed nothing.
As I said, this code worked with iTextSharp release 3.1.1.
Any help is highly appreciated!
View this message in context:
Sent from the iText - General mailing list archive at
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
iText-questions mailing list
[email protected]
Buy the iText book:
Check the site with examples before you ask questions:
You can also search the keywords list:
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy