Search code examples
javaapachefontstomcat6pdfbox

Embedded fonts not found by Tomcat when running web app


I have been searching the net and Stack Overflow for the past month on the issue that I am having with a web application that generates PDF files. I am utilizing PDFBox app-2.0.4.jar and embedding text on these PDF files, specifically with a PDType1Font object only. These objects are passed as parameters either as PDType1Font.HELVETICA OR TIMES_ROMAN. The web application is hosted on Apache Tomcat and The thing is these PDF files get generated without any issues and are visually correct (bold/height/font-type) all throughout the file, however when I check the web app's log, it outputs the following:

<DEBUG 2017-05-17 00:13:19,270 - FontFileFinder - checkFontfile found C:\Windows\FONTS\vijayab.ttf
<DEBUG 2017-05-17 00:13:19,270 - FontFileFinder - checkFontfile check C:\Windows\FONTS\vrinda.ttf
<DEBUG 2017-05-17 00:13:19,270 - FontFileFinder - checkFontfile found C:\Windows\FONTS\vrinda.ttf
<DEBUG 2017-05-17 00:13:19,271 - FontFileFinder - checkFontfile check C:\Windows\FONTS\vrindab.ttf
<DEBUG 2017-05-17 00:13:19,271 - FontFileFinder - checkFontfile found C:\Windows\FONTS\vrindab.ttf
<DEBUG 2017-05-17 00:13:19,271 - FontFileFinder - checkFontfile check C:\Windows\FONTS\webdings.ttf
<DEBUG 2017-05-17 00:13:19,271 - FontFileFinder - checkFontfile found C:\Windows\FONTS\webdings.ttf
<DEBUG 2017-05-17 00:13:19,272 - FontFileFinder - checkFontfile check C:\Windows\FONTS\wingding.ttf
<DEBUG 2017-05-17 00:13:19,272 - FontFileFinder - checkFontfile found C:\Windows\FONTS\wingding.ttf
<DEBUG 2017-05-17 00:13:19,289 - FileSystemFontProvider - Loaded TimesNewRomanPSMT from C:\Windows\FONTS\times.ttf
<DEBUG 2017-05-17 00:13:19,290 - FileSystemFontProvider - Loaded TimesNewRomanPS-BoldMT from C:\Windows\FONTS\timesbd.ttf
<DEBUG 2017-05-17 00:13:19,291 - FileSystemFontProvider - Loaded TimesNewRomanPS-ItalicMT from C:\Windows\FONTS\timesi.ttf
<DEBUG 2017-05-17 00:13:19,292 - FileSystemFontProvider - Loaded TimesNewRomanPS-BoldItalicMT from C:\Windows\FONTS\timesbi.ttf
<DEBUG 2017-05-17 00:13:19,292 - FileSystemFontProvider - Loaded ArialMT from C:\Windows\FONTS\arial.ttf
<DEBUG 2017-05-17 00:13:19,293 - FileSystemFontProvider - Loaded Arial-BoldMT from C:\Windows\FONTS\arialbd.ttf
<DEBUG 2017-05-17 00:13:19,294 - FileSystemFontProvider - Loaded Arial-ItalicMT from C:\Windows\FONTS\ariali.ttf
<DEBUG 2017-05-17 00:13:19,295 - FileSystemFontProvider - Loaded Arial-BoldItalicMT from C:\Windows\FONTS\arialbi.ttf

To my understanding PDFBox comes preinstalled with its own font package so why am I getting these warnings?


Solution

  • 1) "DEBUG" means it is a debug log entry. You have set logging to DEBUG level. Set it to "WARNING" and they will get away.

    2) "To my understanding PDFBox comes preinstalled with its own font package" - no it doesn't, PDFBox has only one font (Liberation Sans Regular) as a worst case fallback. What you see is PDFBox collecting information about what fonts are installed.

    3) The current PDFBox version is 2.0.6.