web stats
Convert XML (CDA, V3 msg) to PDF ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2010, 04:43 PM
sophie sophie is offline
What's HL7?
 
Join Date: Apr 2010
Posts: 4
sophie is on a distinguished road
Default Convert XML (CDA, V3 msg) to PDF ?

Hi, I have an CDA file, which is XML file and it refers to an XSLT stylesheet. If I open this CDA file by IE, it works great. I hope to convert what nicely displayed in IE to a PDF file.

I created an channel. In Summary, I set Incoming Data to XML.

In source, I set Connector Type as "File Reader". Method as "File" . Input "C:/app/mirth/incoming" as Directory and "myCDA.xml" as Filename Filter Pattern.

In Destination, I set Connector Type as "Document Writer" and input "C:/app/mirth/outgoing" as Directory and "generatedPDF.pdf" as File Name. Choose PDF as Document Type. Pasted the whole content of my stylesheet file (.xslt) to template.

After running, I got the below error message under Dashboard. Can you please indicate what's wrong here? Do you have an example of how to convert XML to PDF? Thank you!!
===========================
"ERROR-401: Document connector error
ERROR MESSAGE: Error writing document
java.lang.Exception: org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.webreach.mirth.connectors.doc.DocumentMessageD ispatcher.writeDocument(DocumentMessageDispatcher. java:148)
at com.webreach.mirth.connectors.doc.DocumentMessageD ispatcher.doDispatch(DocumentMessageDispatcher.jav a:105)
at com.webreach.mirth.connectors.doc.DocumentMessageD ispatcher.doSend(DocumentMessageDispatcher.java:19 5)
at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:167)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:45)
at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:180)
at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:147)
at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:233)
at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:123)
at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:90)
at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at com.webreach.mirth.connectors.doc.DocumentMessageD ispatcher.writeDocument(DocumentMessageDispatcher. java:140)
... 26 more

"
Reply With Quote
  #2  
Old 04-29-2010, 03:02 PM
sophie sophie is offline
What's HL7?
 
Join Date: Apr 2010
Posts: 4
sophie is on a distinguished road
Default

Any body knows?
Reply With Quote
  #3  
Old 05-07-2010, 02:36 PM
albertosaez albertosaez is offline
 
Join Date: Sep 2006
Location: Valladolid, Spain
Posts: 842
albertosaez is an unknown quantity at this point
Default

He template doesn't accept XSLT, but HTML so you need to apply the xlst template in a step in source or destination.
Reply With Quote
  #4  
Old 05-20-2010, 10:02 AM
sophie sophie is offline
What's HL7?
 
Join Date: Apr 2010
Posts: 4
sophie is on a distinguished road
Default

thank you!
I have an xml and a XSLT_FO stylesheet. If I used Apache FOP, a well formatted PDF file can be generated. I tried to use Mirth, a PDF file can be generated. However, PDF generated by Mirth just displayed whatever in the xml. The XSLT_FO stylesheet does NOT make any effort.

Looks like Mirth pickup the values or tables directly from the xml, and very likely transferred them to HTML(because it understands html tables) then to PDF. Am I right?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Mirth Corporation