Hello listers.... I got a weird error. I am not using any XML in my code. I
am trying to create a 39barcode on a pdf. The method accepts
ByteArrayOutputStream, String containing a barcode text, int position_ int
posistion_y and returns a ByteArrayOutputStream
It works fine on windows, but on the mainframe I get the following error..
Should I close those streams?

JVMJZBL2007E Stack trace follows:
ExceptionConverter: org.xml.sax.SAXParseException: Content is not allowed in
trailing section.
 at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
 at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
 at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
 at com.lowagie.text.xml.xmp.XmpReader.<init>(Unknown Source)
 at com.lowagie.text.pdf.PdfStamperImp.close(Unknown Source)
 at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)
 at zzz.barcodepgm.printbarcode39(barcodepgm.java:35)
 at xxx.yyy.testpgm.main(testpgm.java:120)
[atal Error]:29:13: Content is not allowed in trailing section.

And this is my code. I don't where this XML thing came from!!!
<code>
 public ByteArrayOutputStream printbarcode39(
   ByteArrayOutputStream baos_in, String barcodetext, int posx, int posy)
   throws IOException, DocumentException {
  ByteArrayOutputStream baos_out = new ByteArrayOutputStream();
  PdfReader reader1 = new PdfReader(baos_in.toByteArray());
  PdfStamper stamp = new PdfStamper(reader1, baos_out);
  PdfContentByte overContent = stamp.getOverContent(1);
  Barcode39 code39ext = new Barcode39();
  code39ext.setExtended(true);
  code39ext.setFont(null);
  code39ext.setCode(barcodetext);
  PdfTemplate tp128 = code39ext.createTemplateWithBarcode(overContent, null,
null);
  overContent.addTemplate(tp128, posx, posy);
  stamp.close();
  return baos_out;
</code>
-- 
View this message in context: 
http://www.nabble.com/Content-is-not-allowed-in-trailing-section-tp19849522p19849522.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to