[
https://issues.apache.org/jira/browse/PDFBOX-3993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240920#comment-16240920
]
Tilman Hausherr commented on PDFBOX-3993:
-----------------------------------------
Here's the code I used:
{code}
try (PDDocument doc = PDDocument.load(new File("sample-pdf.pdf")))
{
PDFTextStripper stripper = new PDFTextStripper();
StringWriter sw = new StringWriter();
stripper.writeText(doc, sw);
System.out.println(sw.getBuffer());
}
{code}
It runs in a second.
> PDFTextStripper.writeText is slow
> ---------------------------------
>
> Key: PDFBOX-3993
> URL: https://issues.apache.org/jira/browse/PDFBOX-3993
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 2.0.4
> Reporter: Ace
> Attachments: sample-pdf.pdf
>
>
> I see this problem has been posted about two years before, and the poster
> said it has been fixed in 2.0.0 version, but now I face this problem when I
> try to parse a pdf file with image in it. I also add logs before and after
> PDFTextStripper.writeText to mark the time spend, it looks like it takes
> quite long to writeText to a StringWriter (sometimes 15s+ for a 220K pdf file
> with image in it). The running environment is in our production server but
> not local.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]