|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
HTML to PDF Generation |
« View previous topic :: View next topic » |
Author |
Message
|
abinaya |
Posted: Tue Jun 20, 2017 8:33 pm Post subject: HTML to PDF Generation |
|
|
Novice
Joined: 20 Jun 2017 Posts: 17
|
Hi All, I am trying to convert HTML content to PDF Content by using java code (using external JAR - org.xhtmlrenderer.pdf.ITextRenderer) in IIB 10.0.8 . I am using the method setDocumentFromString present in the jar which accepts HTML content as string, I am able to generate the PDF content and able to see the content as byte array when I run the java code as standalone from JAVA perspective as "Run As Java Application". When I am running the code from message flow ( calling the Java method from compute node ) I am facing Parser issues.
The JAR files internally use the default JDK parser to load the documents , and when I am running the java code from compute node this parser is not getting loaded and I am landing in a exception "Could not instantiate any SAX 2 parser, including JDK default" . Tried changing JVMsystemProperties of EG to set this property "org.xml.sax.driver" . But still getting same exception.
1) How to find the default JDK Parser (for XML) used by IIB runtime
2) How to overwrite the default JDK parser of IIB runtime
3) any other working solution to convert HTML to PDF Content. I need the JAVA code to return only PDF content and not to write PDF file.
Any suggestions/ideas ?? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 21, 2017 4:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you need the content to be transformed into a pdf why are you parsing at all?
Use the BLOB parser, transform the BLOB into CHAR with CCSID if you must and run your Java method to create the pdf.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
abinaya |
Posted: Wed Jun 21, 2017 5:07 am Post subject: |
|
|
Novice
Joined: 20 Jun 2017 Posts: 17
|
The Parser issues i mentioned in my post is not before calling java. While java is trying to load the HTML contents (which i am passing from compute node as Character ) , the exact error is org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory
I am using core-renderer-2011.04.16.jar (iText methods) for PDF generation
But the same Java code is running perfectly when executed as Standalone java application from Toolkit |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 21, 2017 8:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
abinaya wrote: |
The Parser issues i mentioned in my post is not before calling java. While java is trying to load the HTML contents (which i am passing from compute node as Character ) , the exact error is org.apache.xerces.jaxp.SAXParserFactoryImpl incompatible with javax.xml.parsers.SAXParserFactory
I am using core-renderer-2011.04.16.jar (iText methods) for PDF generation
But the same Java code is running perfectly when executed as Standalone java application from Toolkit |
Excuse my incomprehension but it looks like you are trying to parse an XML document here... Do you need the DOM model to render the result in pdf???  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|