I was writing code to put an SVG image into a pdf and I kept getting an error
message: "Unbalanced save/restore state operators.".  I put together a short
block of code to reproduce the error.

try{
        PdfReader pReader = new
PdfReader("e:\\Tomcat\\webapps\\pdf\\in\\12345.pdf");
        PdfStamper stamper = new PdfStamper(pReader, new
FileOutputStream("e:\\Tomcat\\webapps\\pdf\\out\\12345.pdf"));
        PdfContentByte contentByte = stamper.getOverContent(1);
        PdfTemplate template = contentByte.createTemplate(318.5f, 39.0f);
        Graphics2D graphics = template.createGraphics(318.5f, 39.0f);
        stamper.close();
}catch(Exception e){
        out.println(e.getMessage());
}

-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Error-when-using-createGraphics-tp2249138p2249138.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to