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

glennr <[email protected]> Mon, 14 Dec 2015 07:15:09 -0800 (PST)
Newsgroups gmane.comp.java.lib.itext.general
Message-ID <[email protected]>
--===============3531403707217900483==
Content-Type: multipart/alternative; 
	boundary="----=_Part_16180_814251477.1450106109578"

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

This is the stack trace I get if it helps. =C2=A0Thanks
--------------------------------com.itextpdf.text.DocumentException: com.it=
extpdf.text.exceptions.IllegalPdfSyntaxException: Unbalanced save/restore s=
tate operators. at com.itextpdf.text.pdf.PdfDocument.add(PdfDocument.java:8=
18) at com.itextpdf.text.Document.add(Document.java:278) at rpt.WarrantRpt.=
createReport(WarrantRpt.java:1656) at rpt.ReportManager.writeReport(ReportM=
anager.java:286) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met=
hod) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp=
l.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet=
hodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597=
) at wcon.ConnectionServlet.process(ConnectionServlet.java:615) at wcon.Con=
nectionServlet.doPost(ConnectionServlet.java:368) at javax.servlet.http.Htt=
pServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.se=
rvice(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispa=
tcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http=
.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330=
) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequest=
Handler.java:830) at com.evermind.server.http.HttpRequestHandler.run(HttpRe=
questHandler.java:285) at com.evermind.server.http.HttpRequestHandler.run(H=
ttpRequestHandler.java:126) at com.evermind.util.ReleasableResourcePooledEx=
ecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang=
.Thread.run(Thread.java:619)Caused by: com.itextpdf.text.exceptions.Illegal=
PdfSyntaxException: Unbalanced save/restore state operators. at com.itextpd=
f.text.pdf.PdfContentByte.sanityCheck(PdfContentByte.java:4155) at com.itex=
tpdf.text.pdf.PdfContentByte.reset(PdfContentByte.java:1794) at com.itextpd=
f.text.pdf.PdfContentByte.reset(PdfContentByte.java:1782) at com.itextpdf.t=
ext.pdf.PdfWriter.resetContent(PdfWriter.java:747) at com.itextpdf.text.pdf=
.PdfDocument.endPage(PdfDocument.java:1058) at com.itextpdf.text.pdf.PdfDoc=
ument.newPage(PdfDocument.java:939) at com.itextpdf.text.pdf.PdfDocument.ad=
dPTable(PdfDocument.java:2729) at com.itextpdf.text.pdf.PdfDocument.add(Pdf=
Document.java:756) ... 18 more
      From: iText mailing list [via iText] <ml-node+s2136553n4660958h86@n4.=
nabble.com>
 To: glennr <[email protected]>=20
 Sent: Saturday, December 12, 2015 5:09 AM
 Subject: Re: com.lowagie.text.exceptions.IllegalPdfSyntaxException: Unbala=
nced 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 <[hidden email]> 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=A0Thanks.

---------------------------------------------------------------------------=
---
_______________________________________________
iText-questions mailing list
[hidden email]
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
=20
=20
   If you reply to this email, your message will be added to the discussion=
 below: http://itext.2136553.n4.nabble.com/com-lowagie-text-exceptions-Ille=
galPdfSyntaxException-Unbalanced-save-restore-state-operators-tp4536784p466=
0958.html   To unsubscribe from com.lowagie.text.exceptions.IllegalPdfSynta=
xException: Unbalanced save/restore state operators, click here.
 NAML=20





--
View this message in context: http://itext.2136553.n4.nabble.com/com-lowagi=
e-text-exceptions-IllegalPdfSyntaxException-Unbalanced-save-restore-state-o=
perators-tp4536784p4660960.html
Sent from the iText mailing list archive at Nabble.com.
------=_Part_16180_814251477.1450106109578
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<div style=3D"color:#000; background-color:#fff; font-family:Courier New, c=
ourier, monaco, monospace, sans-serif;font-size:13px"><div id=3D"yui_3_16_0=
_1_1450103737529_47701" class=3D"" dir=3D"ltr">This is the stack trace I ge=
t if it helps. &nbsp;Thanks</div><div id=3D"yui_3_16_0_1_1450103737529_4770=
1" class=3D""><br></div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=
=3D"">----------------</div><div id=3D"yui_3_16_0_1_1450103737529_47701" cl=
ass=3D"">----------------</div><div id=3D"yui_3_16_0_1_1450103737529_47701"=
 class=3D"">com.itextpdf.text.DocumentException: com.itextpdf.text.exceptio=
ns.IllegalPdfSyntaxException: Unbalanced save/restore state operators.</div=
><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" s=
tyle=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47714">=09<=
/span>at com.itextpdf.text.pdf.PdfDocument.add(PdfDocument.java:818)</div><=
div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" sty=
le=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47717">=09</s=
pan>at com.itextpdf.text.Document.add(Document.java:278)</div><div id=3D"yu=
i_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"white-=
space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47720">=09</span>at rpt.W=
arrantRpt.createReport(WarrantRpt.java:1656)</div><div id=3D"yui_3_16_0_1_1=
450103737529_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wr=
ap;" id=3D"yui_3_16_0_1_1450103737529_47723">=09</span>at rpt.ReportManager=
.writeReport(ReportManager.java:286)</div><div id=3D"yui_3_16_0_1_145010373=
7529_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=
=3D"yui_3_16_0_1_1450103737529_47726">=09</span>at sun.reflect.NativeMethod=
AccessorImpl.invoke0(Native Method)</div><div id=3D"yui_3_16_0_1_1450103737=
529_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=
=3D"yui_3_16_0_1_1450103737529_47729">=09</span>at sun.reflect.NativeMethod=
AccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div id=3D"yui_3=
_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"white-spa=
ce:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47732">=09</span>at sun.refl=
ect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:2=
5)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=
=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_4773=
5">=09</span>at java.lang.reflect.Method.invoke(Method.java:597)</div><div =
id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=
=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47738">=09</spa=
n>at wcon.ConnectionServlet.process(ConnectionServlet.java:615)</div><div i=
d=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D=
"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47741">=09</span>a=
t wcon.ConnectionServlet.doPost(ConnectionServlet.java:368)</div><div id=3D=
"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"whi=
te-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47744">=09</span>at ja=
vax.servlet.http.HttpServlet.service(HttpServlet.java:760)</div><div id=3D"=
yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"whit=
e-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47747">=09</span>at jav=
ax.servlet.http.HttpServlet.service(HttpServlet.java:853)</div><div id=3D"y=
ui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"white=
-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47750">=09</span>at com.=
evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatch=
er.java:824)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><=
span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_14501037=
37529_47753">=09</span>at com.evermind.server.http.ServletRequestDispatcher=
.forwardInternal(ServletRequestDispatcher.java:330)</div><div id=3D"yui_3_1=
6_0_1_1450103737529_47701" class=3D""><span class=3D"" style=3D"white-space=
:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47756">=09</span>at com.evermi=
nd.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:83=
0)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=
=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_4775=
9">=09</span>at com.evermind.server.http.HttpRequestHandler.run(HttpRequest=
Handler.java:285)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=
=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1=
450103737529_47762">=09</span>at com.evermind.server.http.HttpRequestHandle=
r.run(HttpRequestHandler.java:126)</div><div id=3D"yui_3_16_0_1_14501037375=
29_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D=
"yui_3_16_0_1_1450103737529_47765">=09</span>at com.evermind.util.Releasabl=
eResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:=
192)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span cla=
ss=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47=
768">=09</span>at java.lang.Thread.run(Thread.java:619)</div><div id=3D"yui=
_3_16_0_1_1450103737529_47701" class=3D"">Caused by: com.itextpdf.text.exce=
ptions.IllegalPdfSyntaxException: Unbalanced save/restore state operators.<=
/div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><span class=3D=
"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1450103737529_47772">=
=09</span>at com.itextpdf.text.pdf.PdfContentByte.sanityCheck(PdfContentByt=
e.java:4155)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=3D""><=
span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_14501037=
37529_47775">=09</span>at com.itextpdf.text.pdf.PdfContentByte.reset(PdfCon=
tentByte.java:1794)</div><div id=3D"yui_3_16_0_1_1450103737529_47701" class=
=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16_0_1_1=
450103737529_47778">=09</span>at com.itextpdf.text.pdf.PdfContentByte.reset=
(PdfContentByte.java:1782)</div><div id=3D"yui_3_16_0_1_1450103737529_47701=
" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_1=
6_0_1_1450103737529_47781">=09</span>at com.itextpdf.text.pdf.PdfWriter.res=
etContent(PdfWriter.java:747)</div><div id=3D"yui_3_16_0_1_1450103737529_47=
701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_=
3_16_0_1_1450103737529_47784">=09</span>at com.itextpdf.text.pdf.PdfDocumen=
t.endPage(PdfDocument.java:1058)</div><div id=3D"yui_3_16_0_1_1450103737529=
_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"y=
ui_3_16_0_1_1450103737529_47787">=09</span>at com.itextpdf.text.pdf.PdfDocu=
ment.newPage(PdfDocument.java:939)</div><div id=3D"yui_3_16_0_1_14501037375=
29_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D=
"yui_3_16_0_1_1450103737529_47790">=09</span>at com.itextpdf.text.pdf.PdfDo=
cument.addPTable(PdfDocument.java:2729)</div><div id=3D"yui_3_16_0_1_145010=
3737529_47701" class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" =
id=3D"yui_3_16_0_1_1450103737529_47793">=09</span>at com.itextpdf.text.pdf.=
PdfDocument.add(PdfDocument.java:756)</div><div id=3D"yui_3_16_0_1_14501037=
37529_47701"></div><div id=3D"yui_3_16_0_1_1450103737529_47701" dir=3D"ltr"=
 class=3D""><span class=3D"" style=3D"white-space:pre-wrap;" id=3D"yui_3_16=
_0_1_1450103737529_47796">=09</span>... 18 more</div><br>  <div style=3D"fo=
nt-family: Courier New, courier, monaco, monospace, sans-serif; font-size: =
13px;" id=3D"yui_3_16_0_1_1450103737529_47704"> <div style=3D"font-family: =
HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;=
 font-size: 16px;" id=3D"yui_3_16_0_1_1450103737529_47703"> <div dir=3D"ltr=
" id=3D"yui_3_16_0_1_1450103737529_47702"> <font size=3D"2" face=3D"Arial" =
id=3D"yui_3_16_0_1_1450103737529_47705"> <hr size=3D"1"> <b><span style=3D"=
font-weight:bold;">From:</span></b> iText mailing list [via iText] &lt;<a h=
ref=3D"/user/SendEmail.jtp?type=3Dnode&node=3D4660960&i=3D0" target=3D"_top=
" rel=3D"nofollow" link=3D"external">[hidden email]</a>&gt;<br> <b><span st=
yle=3D"font-weight: bold;">To:</span></b> glennr &lt;<a href=3D"/user/SendE=
mail.jtp?type=3Dnode&node=3D4660960&i=3D1" target=3D"_top" rel=3D"nofollow"=
 link=3D"external">[hidden email]</a>&gt; <br> <b><span style=3D"font-weigh=
t: bold;">Sent:</span></b> Saturday, December 12, 2015 5:09 AM<br> <b><span=
 style=3D"font-weight: bold;">Subject:</span></b> Re: com.lowagie.text.exce=
ptions.IllegalPdfSyntaxException: Unbalanced save/restore state operators<b=
r> </font> </div> <div class=3D"y_msg_container" id=3D"yui_3_16_0_1_1450103=
737529_47706"><br><div id=3D"yiv3459354796">

=09You are using a version that dates from at least July 2009.
<br>You are experiencing a bug that has been fixed many years ago.
<br>Please upgrade 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 rel=3D"=
nofollow" href=3D"" target=3D"_top" link=3D"external">[hidden email]</a>&gt=
; wrote:
<br>&gt; I am getting the same error when I try to add multiple PdfPTable o=
bjects
<br>&gt; to a
<br>&gt; document.
<br>&gt;=20
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; doc.add(table1);
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; doc.add(table2);
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; doc.close();
<br>&gt;=20
<br>&gt; The thread mentioned doing a cb.saveState() and a cb.restoreState(=
).=20
<br>What
<br>&gt; is "cb"?? &nbsp;Thanks.
<br><br>-------------------------------------------------------------------=
-----------
<br>_______________________________________________
<br>iText-questions mailing list
<br><a rel=3D"nofollow" href=3D"" target=3D"_top" link=3D"external">[hidden=
 email]</a>
<br><a rel=3D"nofollow" target=3D"_blank" href=3D"https://lists.sourceforge=
.net/lists/listinfo/itext-questions" link=3D"external">https://lists.source=
forge.net/lists/listinfo/itext-questions</a><br><br>iText(R) is a registere=
d trademark of 1T3XT BVBA.
<br>Many questions posted to this list can (and will) be answered with a re=
ference to the iText book: <a rel=3D"nofollow" target=3D"_blank" href=3D"ht=
tp://www.itextpdf.com/book/" link=3D"external">http://www.itextpdf.com/book=
/</a><br>Please check the keywords list before you ask for examples: <a rel=
=3D"nofollow" target=3D"_blank" href=3D"http://itextpdf.com/themes/keywords=
.php" link=3D"external">http://itextpdf.com/themes/keywords.php</a><br>

=09
=09
=09
=09<br>
=09<br>
=09<hr noshade=3D"size=3D&quot;1&quot;" color=3D"#cccccc">
=09<div style=3D"color:#444;font:12px tahoma, geneva, helvetica, arial, san=
s-serif;">
=09=09<div style=3D"font-weight:bold;">If you reply to this email, your mes=
sage will be added to the discussion below:</div>
=09=09<a rel=3D"nofollow" target=3D"_blank" href=3D"http://itext.2136553.n4=
.nabble.com/com-lowagie-text-exceptions-IllegalPdfSyntaxException-Unbalance=
d-save-restore-state-operators-tp4536784p4660958.html" link=3D"external">ht=
tp://itext.2136553.n4.nabble.com/com-lowagie-text-exceptions-IllegalPdfSynt=
axException-Unbalanced-save-restore-state-operators-tp4536784p4660958.html<=
/a>
=09</div>
=09<div style=3D"color:#666;font:11px tahoma, geneva, helvetica, arial, san=
s-serif;margin-top:.4em;line-height:1.5em;">
=09=09
=09=09To unsubscribe from com.lowagie.text.exceptions.IllegalPdfSyntaxExcep=
tion: Unbalanced save/restore state operators, <a rel=3D"nofollow" target=
=3D"_blank" href=3D"" link=3D"external">click here</a>.<br>
=09=09<a rel=3D"nofollow" target=3D"_blank" href=3D"http://itext.2136553.n4=
.nabble.com/template/NamlServlet.jtp?macro=3Dmacro_viewer&amp;id=3Dinstant_=
html%21nabble%3Aemail.naml&amp;base=3Dnabble.naml.namespaces.BasicNamespace=
-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeName=
space&amp;breadcrumbs=3Dnotify_subscribers%21nabble%3Aemail.naml-instant_em=
ails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style=
=3D"font:9px serif;" link=3D"external">NAML</a>
=09</div></div><br><br></div> </div> </div></div>

=09
=09
=09
<br/><hr align=3D"left" width=3D"300" />
View this message in context: <a href=3D"http://itext.2136553.n4.nabble.com=
/com-lowagie-text-exceptions-IllegalPdfSyntaxException-Unbalanced-save-rest=
ore-state-operators-tp4536784p4660960.html">Re: com.lowagie.text.exceptions=
.IllegalPdfSyntaxException: Unbalanced save/restore state operators</a><br/=
>
Sent from the <a href=3D"http://itext.2136553.n4.nabble.com/">iText mailing=
 list archive</a> at Nabble.com.<br/>
------=_Part_16180_814251477.1450106109578--


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

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

--===============3531403707217900483==
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
--===============3531403707217900483==--