- February 8, 2017
- Posted by: iSummation Team
- Category: Uncategorized
CFDOCUMENT is really useful tag for generating PDF report but client always need customization and need different font. ACF allow separate font management tab in ColdFusion administrator where you can add additional font that you want to use but unfortunately this feature not available on RAILO. While googling on this I have found feature already requested on RAILO bug tracker but yet not available. Also got Google group discussion where it was mention that how you can manually add font for CFDOCUMENT.
I am trying to simplified whatever written in above group discussion.
- Go to RAILO installation directory, in my case it was C:/RAILO
- Go to lib folder and locate fonts.jar file, take backup of it.
- Extract fonts.jar using any file archiver (I have used 7-Zip) and add fonts inside fonts directory that you like to use in CFDOCUMENT tag.
- Open pd4fonts.properties in your favorite editor and add information about your newly added font. If font family name contains space you need to escape with \.
- Once changes made in property file zip fonts folder using 7-Zip (or any other archiver tool), make sure directory structure maintain as before.
- Rename file from fonts.zip to font.jar and copy it to lib folder.
- Restart RAILO service and you are done.
Below is my property file for reference after adding Impact, Cambria and Calibri font.
Error when loading gists from https://gist.github.com/.Here is CFML code for how to use fonts in PDF.
Error when loading gists from https://gist.github.com/.Hope this help