Custom Search

[Top] [All Lists]

Re: Error: Unbalanced begin/end text operators sinceiText 5

Subject: Re: Error: Unbalanced begin/end text operators sinceiText 5
Date: Mon, 30 Aug 2010 05:15:31 -0700 (PDT)
the code is huge and difficult to supply. In the meantime, I could generate
the same error at the ContentByte level. Here it is obvious that something
strange is going on:
document = new Document();
writer = PdfWriter.GetInstance(document, pdfFile);
cb = writer.DirectContent;
bf = BaseFont.CreateFont(fontfile, BaseFont.WINANSI, true);
cb.SetFontAndSize(bf, fontSize);
cb.SetTextMatrix(a, b, c, d, e, f);  //values for a,b,c,d,e,f : 45, 450,
550, 479, 0, 1
cb.ShowText(contentString);  //value for contentString = "Astrological
The font I use is Century Gothic True Type (GOTHIC.ttf), the contentString
is two words only. I switched back to 3.1.1 and get no error. I compared the
two objects cb and document and they seem the same for both 3.1.1 and 5.0.4
versions. It is strange but in both versions I cannot actually find the cb
content within the document object.  Anyway I'm getting the same error when
using iTextSharp 5.0.4:
Error: Unbalanced begin/end text operators
(By the way, when I use this code instead of the ColumnText code above with
3.1.1 I'm getting huge letters!)
Please help!
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