Skip to content

Instantly share code, notes, and snippets.

@mcculley
Created July 20, 2020 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcculley/a798f5862c9badb7b7ce8802ed5f0eba to your computer and use it in GitHub Desktop.
Save mcculley/a798f5862c9badb7b7ce8802ed5f0eba to your computer and use it in GitHub Desktop.
/**
* Eagerly execute some initialization such as loading of standard fonts.
*/
public static void initializePDFRenderer() {
final PDDocument document = new PDDocument();
new PdfBoxFontResolver(null, document, null, PdfRendererBuilder.PdfAConformance.NONE, false);
try {
document.close();
} catch (final IOException e) {
throw new RuntimeException(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment