Gregor Ambrozic created PDFBOX-3272:
---------------------------------------
Summary: Loaded fonts file descriptors open after closing document
Key: PDFBOX-3272
URL: https://issues.apache.org/jira/browse/PDFBOX-3272
Project: PDFBox
Issue Type: Bug
Components: FontBox
Affects Versions: 2.0.0
Environment: Apache Tomcat, Linux
Reporter: Gregor Ambrozic
I am experiencing problems with TTF fonts loaded for generating PDFs which
eventually result in too many open files on Linux. The PDFBox version I tested
last was 2.0.0-RC3.
Basically for each PDF I create a document and load two fonts which I want to
use. After the document is generated I close all the resources, but the file
descriptors for both fonts remain open.
The file descriptors should be automatically closed or an API should exist to
close font resources.
My basic code:
{{
doc = new PDDocument();
page = new PDPage(PDRectangle.A4);
doc.addPage(page);
PDFont font = PDType0Font.load(doc, new
File(settings.getProperty("font.location")));
PDFont boldFont = PDType0Font.load(doc, new
File(settings.getProperty("bold.font.location")));
PDPageContentStream content = new PDPageContentStream(doc, page);
// add content stuff
content.close();
bos = new ByteArrayOutputStream();
doc.save(bos);
bos.flush();
}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]