You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2019/06/26 16:23:00 UTC
[jira] [Reopened] (PDFBOX-4580) PDFTextStripper::getText() lead to
OutOfMemoryError: Java heap space
[ https://issues.apache.org/jira/browse/PDFBOX-4580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr reopened PDFBOX-4580:
-------------------------------------
Assignee: Tilman Hausherr (was: Andreas Lehmkühler)
> PDFTextStripper::getText() lead to OutOfMemoryError: Java heap space
> --------------------------------------------------------------------
>
> Key: PDFBOX-4580
> URL: https://issues.apache.org/jira/browse/PDFBOX-4580
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.15
> Reporter: Guilhermo
> Assignee: Tilman Hausherr
> Priority: Major
> Attachments: ceh.pdf
>
>
> I just discovered a memory issue (Java heap space) that happen only if we try to use stripper.getText(pdfFile) on a pdf that has missing incorporated fonts (like the one in attachment).
>
> To replicate the issue you can use this snippet with the pdf file in attachment:
>
> {code:java}
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.text.PDFTextStripper;
> import java.io.IOException;
> import java.io.InputStream;
> public class OutOfMemoryExample {
> public static void main(String[] args) throws IOException {
> try(InputStream docStream = Thread.currentThread().getContextClassLoader().getResource("ceh.pdf").openStream();
> PDDocument cd = PDDocument.load(docStream)){
> PDFTextStripper stripper = new PDFTextStripper();
>
> // OutOfMemory here
> String pdfText = stripper.getText(cd);
> System.out.println(pdfText);
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org