Re: com.lowagie.text.exceptions.IllegalPdfSyntaxException: Unbalanced save/restore state operators

Glenn R <[email protected]> Mon, 14 Dec 2015 15:29:20 +0000 (UTC)
Newsgroups gmane.comp.java.lib.itext.general
Message-ID <[email protected]>
--===============4208970918424053700==
Content-Type: multipart/alternative; 
	boundary="----=_Part_714527_1639302675.1450106960924"
Content-Length: 14373

------=_Part_714527_1639302675.1450106960924
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

This is the exception stack trace I get if it helps.-----------------------=
-----
com.itextpdf.text.DocumentException: com.itextpdf.text.exceptions.IllegalPd=
fSyntaxException: Unbalanced save/restore state operators. at com.itextpdf.=
text.pdf.PdfDocument.add(PdfDocument.java:818) at com.itextpdf.text.Documen=
t.add(Document.java:278) at rpt.WarrantRpt.createReport(WarrantRpt.java:165=
6) at rpt.ReportManager.writeReport(ReportManager.java:286) at sun.reflect.=
NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethod=
AccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.Delega=
tingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java=
.lang.reflect.Method.invoke(Method.java:597) at wcon.ConnectionServlet.proc=
ess(ConnectionServlet.java:615) at wcon.ConnectionServlet.doPost(Connection=
Servlet.java:368) at javax.servlet.http.HttpServlet.service(HttpServlet.jav=
a:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at c=
om.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispa=
tcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.forwar=
dInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.Ht=
tpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermin=
d.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.ev=
ermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at c=
om.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableRe=
sourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:619)Caus=
ed by: com.itextpdf.text.exceptions.IllegalPdfSyntaxException: Unbalanced s=
ave/restore state operators. at com.itextpdf.text.pdf.PdfContentByte.sanity=
Check(PdfContentByte.java:4155) at com.itextpdf.text.pdf.PdfContentByte.res=
et(PdfContentByte.java:1794) at com.itextpdf.text.pdf.PdfContentByte.reset(=
PdfContentByte.java:1782) at com.itextpdf.text.pdf.PdfWriter.resetContent(P=
dfWriter.java:747) at com.itextpdf.text.pdf.PdfDocument.endPage(PdfDocument=
.java:1058) at com.itextpdf.text.pdf.PdfDocument.newPage(PdfDocument.java:9=
39) at com.itextpdf.text.pdf.PdfDocument.addPTable(PdfDocument.java:2729) a=
t com.itextpdf.text.pdf.PdfDocument.add(PdfDocument.java:756) ... 18 more
      From: "[email protected]" <[email protected]>
 To: Post all your questions about iText here <[email protected]=
forge.net>=20
 Sent: Saturday, December 12, 2015 4:57 AM
 Subject: Re: [iText-questions] com.lowagie.text.exceptions.IllegalPdfSynta=
xException: Unbalanced save/restore state operators
  =20
You are using a version that dates from at least July 2009.
You are experiencing a bug that has been fixed many years ago.
Please upgrade to a recent version of iText if you want to solve your
problem.


On Fri, 11 Dec 2015 06:40:27 -0800 (PST), glennr <[email protected]> wrote:
> I am getting the same error when I try to add multiple PdfPTable objects
> to a
> document.
>=20
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 doc.add(table1);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 doc.add(table2);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 doc.close();
>=20
> The thread mentioned doing a cb.saveState() and a cb.restoreState().=20
What
> is "cb"??=C2=A0 Thanks.

---------------------------------------------------------------------------=
---
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a refere=
nce to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf=
.com/themes/keywords.php


 
------=_Part_714527_1639302675.1450106960924
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:Courier New, courier, monaco, monospace, sans-serif;font-size:13=
px"><div id=3D"yui_3_16_0_1_1450103737529_41221">This is the exception stac=
k trace I get if it helps.</div><div id=3D"yui_3_16_0_1_1450103737529_41220=
">--------------</div><div id=3D"yui_3_16_0_1_1450103737529_40952" class=3D=
"">--------------<br></div><div id=3D"yui_3_16_0_1_1450103737529_40956" cla=
ss=3D"">com.itextpdf.text.DocumentException: com.itextpdf.text.exceptions.I=
llegalPdfSyntaxException: Unbalanced save/restore state operators.</div><di=
v id=3D"yui_3_16_0_1_1450103737529_40958" class=3D""><span class=3D"" style=
=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40960">=09</spa=
n>at com.itextpdf.text.pdf.PdfDocument.add(PdfDocument.java:818)</div><div =
id=3D"yui_3_16_0_1_1450103737529_40962" class=3D""><span class=3D"" style=
=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40964">=09</spa=
n>at com.itextpdf.text.Document.add(Document.java:278)</div><div id=3D"yui_=
3_16_0_1_1450103737529_40966" class=3D""><span class=3D"" style=3D"white-sp=
ace:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40968">=09</span>at rpt.War=
rantRpt.createReport(WarrantRpt.java:1656)</div><div id=3D"yui_3_16_0_1_145=
0103737529_40970" class=3D""><span class=3D"" style=3D"white-space:pre-wrap=
;" id=3D"yui_3_16_0_1_1450103737529_40972">=09</span>at rpt.ReportManager.w=
riteReport(ReportManager.java:286)</div><div id=3D"yui_3_16_0_1_14501037375=
29_40974" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D=
"yui_3_16_0_1_1450103737529_40976">=09</span>at sun.reflect.NativeMethodAcc=
essorImpl.invoke0(Native Method)</div><div id=3D"yui_3_16_0_1_1450103737529=
_40978" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"y=
ui_3_16_0_1_1450103737529_40980">=09</span>at sun.reflect.NativeMethodAcces=
sorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div id=3D"yui_3_16_0=
_1_1450103737529_40982" class=3D""><span class=3D"" style=3D"white-space:pr=
e-wrap;" id=3D"yui_3_16_0_1_1450103737529_40984">=09</span>at sun.reflect.D=
elegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</d=
iv><div id=3D"yui_3_16_0_1_1450103737529_40986" class=3D""><span class=3D""=
 style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40988">=
=09</span>at java.lang.reflect.Method.invoke(Method.java:597)</div><div id=
=3D"yui_3_16_0_1_1450103737529_40990" class=3D""><span class=3D"" style=3D"=
white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40992">=09</span>at=
 wcon.ConnectionServlet.process(ConnectionServlet.java:615)</div><div id=3D=
"yui_3_16_0_1_1450103737529_40994" class=3D""><span class=3D"" style=3D"whi=
te-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_40996">=09</span>at wc=
on.ConnectionServlet.doPost(ConnectionServlet.java:368)</div><div id=3D"yui=
_3_16_0_1_1450103737529_40998" class=3D""><span class=3D"" style=3D"white-s=
pace:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41000">=09</span>at javax.=
servlet.http.HttpServlet.service(HttpServlet.java:760)</div><div id=3D"yui_=
3_16_0_1_1450103737529_41002" class=3D""><span class=3D"" style=3D"white-sp=
ace:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41004">=09</span>at javax.s=
ervlet.http.HttpServlet.service(HttpServlet.java:853)</div><div id=3D"yui_3=
_16_0_1_1450103737529_41006" class=3D""><span class=3D"" style=3D"white-spa=
ce:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41008">=09</span>at com.ever=
mind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j=
ava:824)</div><div id=3D"yui_3_16_0_1_1450103737529_41010" class=3D""><span=
 class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_145010373752=
9_41012">=09</span>at com.evermind.server.http.ServletRequestDispatcher.for=
wardInternal(ServletRequestDispatcher.java:330)</div><div id=3D"yui_3_16_0_=
1_1450103737529_41014" class=3D""><span class=3D"" style=3D"white-space:pre=
-wrap;" id=3D"yui_3_16_0_1_1450103737529_41016">=09</span>at com.evermind.s=
erver.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)</=
div><div id=3D"yui_3_16_0_1_1450103737529_41018" class=3D""><span class=3D"=
" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41020">=
=09</span>at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHan=
dler.java:285)</div><div id=3D"yui_3_16_0_1_1450103737529_41022" class=3D""=
><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_145010=
3737529_41024">=09</span>at com.evermind.server.http.HttpRequestHandler.run=
(HttpRequestHandler.java:126)</div><div id=3D"yui_3_16_0_1_1450103737529_41=
026" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_=
3_16_0_1_1450103737529_41028">=09</span>at com.evermind.util.ReleasableReso=
urcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)<=
/div><div id=3D"yui_3_16_0_1_1450103737529_41030" class=3D""><span class=3D=
"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41032">=
=09</span>at java.lang.Thread.run(Thread.java:619)</div><div id=3D"yui_3_16=
_0_1_1450103737529_41034" class=3D"">Caused by: com.itextpdf.text.exception=
s.IllegalPdfSyntaxException: Unbalanced save/restore state operators.</div>=
<div id=3D"yui_3_16_0_1_1450103737529_41036" class=3D""><span class=3D"" st=
yle=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_41038">=09</=
span>at com.itextpdf.text.pdf.PdfContentByte.sanityCheck(PdfContentByte.jav=
a:4155)</div><div id=3D"yui_3_16_0_1_1450103737529_41040" class=3D""><span =
class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529=
_41042">=09</span>at com.itextpdf.text.pdf.PdfContentByte.reset(PdfContentB=
yte.java:1794)</div><div id=3D"yui_3_16_0_1_1450103737529_41044" class=3D""=
><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_145010=
3737529_41046">=09</span>at com.itextpdf.text.pdf.PdfContentByte.reset(PdfC=
ontentByte.java:1782)</div><div id=3D"yui_3_16_0_1_1450103737529_41048" cla=
ss=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1=
_1450103737529_41050">=09</span>at com.itextpdf.text.pdf.PdfWriter.resetCon=
tent(PdfWriter.java:747)</div><div id=3D"yui_3_16_0_1_1450103737529_41052" =
class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_=
0_1_1450103737529_41054">=09</span>at com.itextpdf.text.pdf.PdfDocument.end=
Page(PdfDocument.java:1058)</div><div id=3D"yui_3_16_0_1_1450103737529_4105=
6" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_=
16_0_1_1450103737529_41058">=09</span>at com.itextpdf.text.pdf.PdfDocument.=
newPage(PdfDocument.java:939)</div><div id=3D"yui_3_16_0_1_1450103737529_41=
060" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_=
3_16_0_1_1450103737529_41062">=09</span>at com.itextpdf.text.pdf.PdfDocumen=
t.addPTable(PdfDocument.java:2729)</div><div id=3D"yui_3_16_0_1_14501037375=
29_41064" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D=
"yui_3_16_0_1_1450103737529_41066">=09</span>at com.itextpdf.text.pdf.PdfDo=
cument.add(PdfDocument.java:756)</div><div dir=3D"ltr" id=3D"yui_3_16_0_1_1=
450103737529_41068" class=3D""><span class=3D"" style=3D"white-space:pre-wr=
ap;" id=3D"yui_3_16_0_1_1450103737529_41070">=09</span>... 18 more</div><br=
>  <div style=3D"font-family: Courier New, courier, monaco, monospace, sans=
-serif; font-size: 13px;" id=3D"yui_3_16_0_1_1450103737529_40817"> <div sty=
le=3D"font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida =
Grande, sans-serif; font-size: 16px;" id=3D"yui_3_16_0_1_1450103737529_4081=
6"> <div dir=3D"ltr" id=3D"yui_3_16_0_1_1450103737529_40815"> <font size=3D=
"2" face=3D"Arial" id=3D"yui_3_16_0_1_1450103737529_40814"> <hr size=3D"1">=
 <b><span style=3D"font-weight:bold;">From:</span></b> "[email protected]" &l=
t;[email protected]&gt;<br> <b><span style=3D"font-weight: bold;">To:</span><=
/b> Post all your questions about iText here &lt;[email protected]=
ceforge.net&gt; <br> <b><span style=3D"font-weight: bold;">Sent:</span></b>=
 Saturday, December 12, 2015 4:57 AM<br> <b><span style=3D"font-weight: bol=
d;">Subject:</span></b> Re: [iText-questions] com.lowagie.text.exceptions.I=
llegalPdfSyntaxException: Unbalanced save/restore state operators<br> </fon=
t> </div> <div class=3D"y_msg_container" id=3D"yui_3_16_0_1_1450103737529_4=
0818"><br>You are using a version that dates from at least July 2009.<br>Yo=
u are experiencing a bug that has been fixed many years ago.<br>Please upgr=
ade to a recent version of iText if you want to solve your<br>problem.<br><=
br><br>On Fri, 11 Dec 2015 06:40:27 -0800 (PST), glennr &lt;<a ymailto=3D"m=
ailto:[email protected]" href=3D"mailto:[email protected]">[email protected]</=
a>&gt; wrote:<br>&gt; I am getting the same error when I try to add multipl=
e PdfPTable objects<br>&gt; to a<br>&gt; document.<br>&gt; <br>&gt;&nbsp; &=
nbsp; &nbsp; &nbsp;  doc.add(table1);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  d=
oc.add(table2);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;  doc.close();<br>&gt; <b=
r>&gt; The thread mentioned doing a cb.saveState() and a cb.restoreState().=
 <br>What<br>&gt; is "cb"??&nbsp; Thanks.<br><br>--------------------------=
----------------------------------------------------<br>___________________=
____________________________<br>iText-questions mailing list<br><a ymailto=
=3D"mailto:[email protected]" href=3D"mailto:iText-ques=
[email protected]">[email protected]</a><br><=
a href=3D"https://lists.sourceforge.net/lists/listinfo/itext-questions" tar=
get=3D"_blank">https://lists.sourceforge.net/lists/listinfo/itext-questions=
</a><br><br>iText(R) is a registered trademark of 1T3XT BVBA.<br>Many quest=
ions posted to this list can (and will) be answered with a reference to the=
 iText book: <a href=3D"http://www.itextpdf.com/book/" target=3D"_blank">ht=
tp://www.itextpdf.com/book/</a><br>Please check the keywords list before yo=
u ask for examples: <a href=3D"http://itextpdf.com/themes/keywords.php" tar=
get=3D"_blank">http://itextpdf.com/themes/keywords.php</a><br><br><br></div=
> </div> </div></div></body></html>
------=_Part_714527_1639302675.1450106960924--


--===============4208970918424053700==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============4208970918424053700==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
--===============4208970918424053700==--