knazarenkov opened a new pull request, #151: URL: https://github.com/apache/pdfbox/pull/151
Given: PDF with AcroForm with N text fields and M fonts loaded. Problem: When PDAcroForm.getDefaultResources() is called, new PDResource with new direct font cache is created. So whenever PDTextField.setValue() is called, PDFontFactory.createFont(), which is expensive operation, is called M + 1 times - M times in AppearanceGeneratorHelper and once when parsing appearance string in PDDefaultAppearanceString. So setting default appearance for N fields would cause fonts to be loaded N * (M + 1) times. This PR's intention is to introduce AcroForm-level direct font cache that would be reused in each instance created by PDAcroForm.getDefaultResources() -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
