pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Avdonin <desha...@gmail.com>
Subject pdfbox 2.0.0 one PDDocument for multiply using
Date Tue, 16 Jun 2015 14:40:45 GMT
Dear all,

I try use pdfbox 2.0.0 with embedded unicode fonts and found that font
loading works near 1000 ms.
font = PDType0Font.load(document, new
FileInputStream("fonts/Arial-Unicode-Regular.ttf"));
fontBold = PDType0Font.load(document, new
FileInputStream("fonts/Arial-Unicode-Bold.ttf"));

But, I need faster. I tried to create one PDDocument with fonts then save
it to byte[]. And when i need to create pdf, I load it from byte[]
document = PDDocument.load(new ByteArrayInputStream(DOCUMENT_TEMPLATE));

But I have a problem. First document is created fine, but next one gets
error:
Exception in thread "main" java.lang.NullPointerException
at org.apache.fontbox.ttf.TTFSubsetter.add(TTFSubsetter.java:106)
at org.apache.fontbox.ttf.TTFSubsetter.addAll(TTFSubsetter.java:123)
at
org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.subset(TrueTypeEmbedder.java:279)
at org.apache.pdfbox.pdmodel.font.PDType0Font.subset(PDType0Font.java:141)
at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:983)

Could you suggest how i can improve speed of creating pdf with embedded
unicode fonts?

Thanks
-----
Best regards, Ivan Avdonin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message