This is a question in reference to creating a pdf file and using the silent
print option in javascript

i am getting the following error:
Error: The writer in PdfContentByte is null.

i am using the SaxParser and XML file to create the pdf file.  With out the
line
writer.addJavaScript("this.print(false);",false);
it works fine and creates a pdf w/ no problem.


here is the code:
-----------------------------------------------------------------
byte[] bytes                             = sXMLScripts.getBytes();
ByteArrayInputStream bais       = new ByteArrayInputStream(bytes);
baos                                       = new ByteArrayOutputStream();

Document document                = new Document(PageSize.A4, 10, 10, 40,
10);
PdfWriter writer                      = PdfWriter.getInstance(document,
baos);
writer.addJavaScript("this.print(false);",false);

SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
parser.parse(new InputSource(bais),new SAXiTextHandler(document));




-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to