You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "hust.zcheng@gmail.com" <hu...@gmail.com> on 2017/11/14 07:15:02 UTC

Make reuse of PDFont instance?

HI,

I found PDFontFactory create new instances of PDFonts for every dictionary, even for the same font or same font dictionary. 

Can I make PDFontFactory reuse PDFont instances to speed up parsing performance and reduce memory usage? What is the reason for PDFontFactory not to cache PDFont instances (for a single PDF document)?


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


Re: Make reuse of PDFont instance?

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 14.11.2017 um 08:15 schrieb hust.zcheng@gmail.com:
> HI,
>
> I found PDFontFactory create new instances of PDFonts for every dictionary, even for the same font or same font dictionary.
>
> Can I make PDFontFactory reuse PDFont instances to speed up parsing performance and reduce memory usage? What is the reason for PDFontFactory not to cache PDFont instances (for a single PDF document)?

Because it is cached elsewehere, see PDResources.java.

Tilman

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