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 15:38:47 +0200
alrts wrote:
> Paolo, 
> 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();
> document.Open();
> writer = PdfWriter.GetInstance(document, pdfFile);
It would be very strange if this worked.
You're opening the document before creating the writer.
I don't think this is your code sample.
> I switched back to 3.1.1 and get no error.
Maybe not, but your PDF has an error.
The "Unbalanced begin/end text" exception makes sure
you don't create PDFs with that error.
> Please help!
You need an EndText() for every BeginText(), and vice-versa.
Somewhere in your code, you have a BeginText() but EndText() is
never reached. Or you have an EndText(), but there wasn't a
BeginText() to begin with.
You CAN NOT reproduce that error with your code snippet.
Try this example:
Does it work?
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