Hi everyone,
I am stuck. I am trying to use the tagmap and an xml file to output a
pdf. No matter what I pass as a path to the tagmap, I get a init error in
the tagmap object.
The stack trace is at the bottom of them email, along with the appropriate
code that is generating the error.
thanks bunches. I will owe someone bigtime.
org.jdom.Document xml = new org.jdom.Document(guide.getXml());
XMLOutputter serializer = new XMLOutputter(" ", true);
StringWriter sw = new StringWriter();
serializer.output(xml, sw);
StringReader sr = new StringReader(sw.toString());
InputSource is = new InputSource(sr);
File xmlFile = new File(location,user.getUserName() + ".xml");
//convenience method for writing xml to a file
//I have confirmed that I have an XML file that is being written
//here, so far so good.
XSLUtil.serialize(xml, xmlFile.getAbsolutePath());
//construct document
com.lowagie.text.Document documentA = new
com.lowagie.text.Document(PageSize.A4, 80, 50, 30, 65);
//empty pdf file is created by the following
File pdfFile = new File(location , "test.pdf");
PdfWriter.getInstance(documentA, new FileOutputStream(pdfFile));
//I tried the below first, but got the same error
//tagmap.xml is at tagmap.xml is at this location
//String tagmap = "/tdk/webapps/hra/WEB-INF/src/xsl/tagmap.xml";
File = new File("test");
//the following will output "/tdk/webapps/hra/WEB-INF/build"
//so I put my tagmap.xml file in this directory and tried it relative, that
is "tagmap.xml"
//same error
System.out.println(file.getAbsolutePath());
String tagmap = "tagmap.xml";
//following will generate an error
XmlParser.parse(documentA, is, tagmap);
[java] ExceptionConverter: ExceptionConverter:
org.xml.sax.SAXParseException: File "null" not found.
[java] at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1066)
[java] at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:499)
[java] at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:309)
[java] at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:951)
[java] at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
[java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
[java] at com.lowagie.text.xml.TagMap.init(Unknown Source)
[java] error processing user 100
[java] at com.lowagie.text.xml.TagMap.<init>(Unknown Source)
[java] at com.lowagie.text.xml.XmlParser.go(Unknown Source)
[java] at com.lowagie.text.xml.XmlParser.parse(Unknown Source)
[java] at
com.rhoderunner.hra.main.GuideGenerator.main(GuideGenerator.java:94)
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions