Thanks Tilmann, of course, it's a broken symbol link. No clue way I
didn't look for it before. I guess I was just thinking it has to do with
PDFBox itself and I didn't know that it checks the local file system.

Here is how I checked the file:

file -b /usr/share/fonts/truetype/fonts-japanese-gothic.ttf
# broken symbolic link to /etc/alternatives/fonts-japanese-gothic.ttf

Best regards Valentin

 

On 15.10.19 18:15, Tilman Hausherr wrote:
> Does that font file exist or not, and is it accessible (user rights),
> and is it a file or some sort of link? If it is a link, does the
> target exist?
>
> /usr/share/fonts/truetype/fonts-japanese-gothic.ttf
>
>
> Tilman
>
> Am 15.10.2019 um 18:09 schrieb Valentin Wittich:
>> ps: I forgot to attach the stack trace:
>>
>> 15-Oct-2019 18:06:18.130 WARNING [https-jsse-nio-8443-exec-45]
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.loadDiskCache
>> New fonts found, font cache will be re-built
>> 15-Oct-2019 18:06:18.130 WARNING [https-jsse-nio-8443-exec-45]
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init> Building
>> on-disk font cache, this may take a while
>> 15-Oct-2019 18:06:18.198 SEVERE [https-jsse-nio-8443-exec-45]
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeFont
>> Could not load font file:
>> /usr/share/fonts/truetype/fonts-japanese-gothic.ttf
>>   java.io.FileNotFoundException:
>> /usr/share/fonts/truetype/fonts-japanese-gothic.ttf (No such file or
>> directory)
>>      at java.io.RandomAccessFile.open0(Native Method)
>>      at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
>>      at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
>>      at
>> org.apache.fontbox.ttf.BufferedRandomAccessFile.<init>(BufferedRandomAccessFile.java:88)
>>      at
>> org.apache.fontbox.ttf.RAFDataStream.<init>(RAFDataStream.java:63)
>>      at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:84)
>>      at
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeFont(FileSystemFontProvider.java:539)
>>      at
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.scanFonts(FileSystemFontProvider.java:255)
>>      at
>> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init>(FileSystemFontProvider.java:234)
>>      at
>> org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.<clinit>(FontMapperImpl.java:128)
>>      at
>> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getProvider(FontMapperImpl.java:147)
>>      at
>> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFont(FontMapperImpl.java:411)
>>      at
>> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFontBoxFont(FontMapperImpl.java:374)
>>      at
>> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getFontBoxFont(FontMapperImpl.java:348)
>>      at
>> org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:146)
>>      at
>> org.apache.pdfbox.pdmodel.font.PDType1Font.<clinit>(PDType1Font.java:79)
>>
>> On 15.10.19 17:54, Valentin Wittich wrote:
>>> Hi there,
>>>
>>> not sure if that is a bug or something with my local installation.
>>> Either way I would like to understand the root of the issue.
>>>
>>> I'm getting a FileNotFoundException if I use
>>> PDType1Font.HELVETICA_BOLD.
>>>
>>> All I do is
>>>
>>> PDPageContentStream contentStream;
>>> contentStream.beginText(); PDFont font; font =
>>> PDType1Font.HELVETICA_BOLD; contentStream.setFont(font, 10.0);
>>> contentStream.newLineAtOffset(60.0, 775.0);
>>> contentStream.showText("Hello world!"); contentStream.endText();
>>>
>>> Any clue what the issue might be?
>>>
>>> Regards Valentin
>>>
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to