web stats
Convert RTF to PDF - REALLY - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2015, 09:55 AM
regnor regnor is offline
What's HL7?
 
Join Date: Nov 2009
Location: Franklin, TN
Posts: 1
regnor is on a distinguished road
Cool Convert RTF to PDF - REALLY

I have read numerous short threads with "is it possible" or "I would try this" - but no-one has said -- Here is how you convert an HL7 message that contains RTF encoded data in OBX 5 and deliver a PDF in the message to its destination.

Please respond with either instructions or a location to find instructions - if you have "first hand knowledge"

Have both Mirth 2.3.1 and Mirth 3.2.0 in Linux environment.

Thanks
Reply With Quote
  #2  
Old 05-06-2015, 10:14 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

You can use FileUtil to convert the RTF to plain text. Then use a Document Writer to create a PDF from said text, and store it as an attachment. Then in a subsequent destination, include the attachment token created by the Document Writer in OBX.5 or wherever you need it. Should be fairly simple to do.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 08-06-2015, 05:27 PM
eastken eastken is offline
What's HL7?
 
Join Date: Jun 2015
Posts: 1
eastken is on a distinguished road
Default

Now I didn't found a way that can convert RTF to PDF directly.
But it also can be achieved in other way.
Firstly, you have to convert RTF to text. Then copy it to a Word file, and last, it's easy to convert a Word to PDF with a PDF converter.
Reply With Quote
  #4  
Old 08-07-2015, 04:13 AM
rodrosa rodrosa is offline
OBX.2 Kenobi
 
Join Date: Jul 2013
Posts: 79
rodrosa is on a distinguished road
Default

Quote:
Originally Posted by eastken View Post
Now I didn't found a way that can convert RTF to PDF directly.
But it also can be achieved in other way.
Firstly, you have to convert RTF to text. Then copy it to a Word file, and last, it's easy to convert a Word to PDF with a PDF converter.
You can use the libreOffice command line interface to do this. By the way, you can use JOD Converter to manage the conversion process.
Reply With Quote
  #5  
Old 10-20-2015, 10:14 PM
harmanpreet11 harmanpreet11 is offline
Mirth Newb
 
Join Date: Oct 2012
Posts: 6
harmanpreet11 is on a distinguished road
Send a message via Skype™ to harmanpreet11
Default Problem while converting RTF to Text

I have used the source code of RTFEditorKit to convert RTF to Plane text as shown below:

FileInputStream stream = new FileInputStream(args[0]);

RTFEditorKit kit = new RTFEditorKit();
Document doc = kit.createDefaultDocument();
kit.read(stream, doc, 0);

String plainText = doc.getText(0, doc.getLength());
System.out.println("text" + plainText);


**** But in RTF document, i have faced an issue as unable to parse the TRID assigned in the body content. I am unable to fetch and place the content on specific TRID location.

**** I have created fetching in java using RTFEditorKit.
Reply With Quote
Reply

Tags
pdf, rtf

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 -8. The time now is 06:41 PM.


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