Custom fonts > PDFs

224 views
Skip to first unread message

Nando Breiter

unread,
Jul 1, 2015, 5:44:14 PM7/1/15
to lu...@googlegroups.com
I'm generating a PDF using cfdocument (a Swiss postal pay slip) that needs a custom OCRB font for the scannable code line at the bottom. Any fairly current advice on how to get custom fonts to work in cfdocument?

Thanks in advance,

Nando


Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

Simon Goldschmidt

unread,
Jul 1, 2015, 8:45:48 PM7/1/15
to lu...@googlegroups.com
It's not a direct answer to your question. We took a different approach to create scan codes, using zxing to create an image.... https://github.com/zxing/zxing/wiki/Getting-Started-Developing

To make it work, we stick the core-3.1.0.jar and javase-3.1.0.jar files in the tomcat/lib directory and the following will create a code-128 barcode:

<cfset format=createObject('java','com.google.zxing.BarcodeFormat')>
<cfset writer=createObject('java','com.google.zxing.oned.Code128Writer').init()>
<cfset matrix=createObject('java','com.google.zxing.client.j2se.MatrixToImageWriter')>
<cfset barcode=writer.encode('123456',format.CODE_128,75,75)>
<cfset image=ImageNew(matrix.toBufferedImage(barcode))>
<cfimage action="writeToBrowser" source="#image#" format="png">

Simon

Michael Hnat

unread,
Jul 2, 2015, 2:32:05 AM7/2/15
to lu...@googlegroups.com
Hi Nando,
 
I've written a blog article a while ago how to do this. See here: http://blog.hnat.de/post.cfm/schriftarten-zu-railo-hinzufugen
Yes, I'v written it in German :-)
 
Hope this helps.
 
Best,
Michi
 
 
 

Von: "Nando Breiter" <na...@aria-media.com>
Gesendet: Mittwoch, 1. Juli 2015 23:44
An: "lu...@googlegroups.com" <lu...@googlegroups.com>
Betreff: [Lucee] Custom fonts > PDFs
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAGHrs%3D_ZQN%2BJ%2ButcLuBmcnwa1G%3D9ewr%2BPOH5%2Bgt37-ySDFXVsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
 

Nando Breiter

unread,
Jul 2, 2015, 5:51:52 AM7/2/15
to lu...@googlegroups.com
Hoo ha!! Thanks Michael. I'll give that a try - should work. :-)



Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

Igal @ Lucee.org

unread,
Jul 3, 2015, 1:36:02 PM7/3/15
to lu...@googlegroups.com
but in general:

    1) add your font to the fonts folder in fonts.jar archive
    2) edit pdf4fonts.properties to include your font with a name (escape spaces with a \)
    3) restart Tomcat

Igal Sapir
Lucee Core Developer
Lucee.org

Reply all
Reply to author
Forward
0 new messages