web stats
Adding Code39 barcodes into PDF generated by Mirth Connect. - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 10-22-2017, 05:24 PM
SHague SHague is offline
What's HL7?
Join Date: Jul 2015
Posts: 4
SHague is on a distinguished road
Default Adding Code39 barcodes into PDF generated by Mirth Connect.


Recently I have needed to output barcodes in PDF’s generated from Mirth. I’ve seen plenty of discussion around this, but not a clear solution. I did have success with using a TrueType Code39 font, but as the font wasn’t embedded in the PDF itself, the same font needed to be installed everywhere the PDF was going to be viewed which was not practical for me.

Using an article from Code Project about creating barcodes using HTML, CSS and Javascript (https://www.codeproject.com/Articles...L-CSS-and-Java), I have been able to come up with a working solution.

Rather than embedding the Javascript into the HTML generated as the article outlines, I used the Javascript in the transformer itself (In production, these functions would be put into a code template library). I also simplified the Javascript by removing parts of it I didn’t require (like human readable output and check digit).

Attached is a working channel for Mirth Connect v3.5.1 that simply output’s ORC-4 as a barcode, and a sample PDF that was generated.


Attached Files
File Type: xml Code39 Barcode In PDF.xml (22.8 KB, 15 views)
File Type: pdf Code39.pdf (2.5 KB, 22 views)

Last edited by SHague; 10-22-2017 at 05:26 PM. Reason: Oops - left off the PDF sample!
Reply With Quote
Old 10-23-2017, 04:43 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
Join Date: Sep 2014
Location: Michigan
Posts: 577
kirbykn2 is on a distinguished road

Thanks for sharing!

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote

barcode, code39, pdf

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 07:50 PM.

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