Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font issue on Ubuntu machine in parsing PDF File

I have an application on my Ubuntu 14.04.x Machine. This application does text mining on PDF files. I suspect that it is using Apache Tika etc...

The problem is that, during its reading process, I get the following warning:

2015-09-10 14:15:35 [WARN] FontManager Font not found: CourierNewPSMT
2015-09-10 14:15:36 [WARN] FontManager Font not found: CourierNewPSMT
2015-09-10 14:19:33 [WARN] FontManager Font not found: Helvetica
2015-09-10 14:19:34 [WARN] FontManager Font not found: ESQWSF+Helvetica
2015-09-10 14:19:34 [WARN] FontManager Font not found: ESQWSF+Helvetica
2015-09-10 14:19:34 [WARN] FontManager Font not found: ESQWSF+Helvetica
......

How can I get those fonts on my machine? Or is it some java lib that I am missing for fonts?

like image 958
MaatDeamon Avatar asked Sep 10 '15 18:09

MaatDeamon


1 Answers

I would do a three step approach to fix this issue.

  1. Analyse what files are searched for and not found using strace
  2. Use apt-file to search for the package providing these files
  3. Install the missing package

1.) Install strace if it's not already installed sudo apt-get install strace

Check what files are used by your app:

$> strace <your app> 2>&1 | grep open

you can further filter this for ENOENT errors:

$> strace <your app> 2>&1 | grep open | grep ENOENT

Now you should know what files are missing.

2.) Check what package is providing this file. (dpkg -S only works for already installed packages)

su
apt-get install apt-file
apt-file update
apt-file search <filename>

3.) install that package using apt-get install <package>

I've no Ubuntu here, but the MS fonts are normally available in a package called "mscorefont" or similar.

like image 141
Hans Dampf Avatar answered Nov 10 '22 04:11

Hans Dampf