[
https://issues.apache.org/jira/browse/PDFBOX-6020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17977617#comment-17977617
]
Tilman Hausherr edited comment on PDFBOX-6020 at 6/15/25 3:18 PM:
------------------------------------------------------------------
I did another regression tests as described and here's the result excel file:
[^content_diffs_no_exceptions.xlsx]
Compare columns L with N, and V with W.
Some files that are different: [^PDFBOX-1299-1.pdf]
[^6J2J7WJ5AW7VTWLZAY2ZVONIYZY7CVKU.pdf] [^0010805.pdf]
was (Author: tilman):
I did another regression tests as described and here's the result excel file:
Compare columns L with N, and V with W.
> mix of subscript and superscript can lead to unnecessary new lines during
> text extraction
> -----------------------------------------------------------------------------------------
>
> Key: PDFBOX-6020
> URL: https://issues.apache.org/jira/browse/PDFBOX-6020
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 3.0.5 PDFBox
> Reporter: Markus Seifert
> Priority: Minor
> Attachments: 0010805.pdf, 6J2J7WJ5AW7VTWLZAY2ZVONIYZY7CVKU.pdf,
> DE102016007628A1-Page2.pdf, NAKON57LBMRU2ACXUKRCTU5FCBPX4AN2.pdf,
> PDFBOX-1299-1.pdf, PDFBOX-6020-DE102016007628A1-p2-219.txt,
> PDFBOX-6020-DE102016007628A1-p2-305.txt, PDFBOX-6020-DE102016007628A1-p2.pdf,
> content_diffs_no_exceptions.xlsx, image-2025-06-13-11-08-06-836.png,
> image-2025-06-13-11-10-27-514.png
>
>
> I'm currently upgrading our usage of PDFBox from Version 2.0.19 to 3.0.5.
> Worked out fine so far but one of our JUnit-Tests failed with the new
> version. During text extraction by using PDFTextStripper unnecessary line
> feeds were created for a line, that contained subscript as well as
> superscript text. While debugging the issue I found some changes that were
> made in Methode PDFTextStripper.writePage(). I think maxYForLine,
> maxHeightForLine and minYTopForLine, which are used for the overlap-check,
> are reset too often.
>
> There's a check made with the value of 'Math.abs(position.getX() -
> lastPosition.getTextPosition().getX())'. But I think is might have to be
> changed to 'Math.abs(position.getX() - (lastPosition.getTextPosition().getX()
> + lastPosition.getTextPosition().getWidth()))' to find relevant gaps.
>
> An example-PDF can be downloaded from
> [here|https://patentimages.storage.googleapis.com/57/b2/2f/3b5ffe86d83ef5/DE102016007628A1.pdf]
>
> The text-line we had problems with was on page 2: 'gin-Anion
> (12-Wolframato-1-phosphat) kann durch die Summenformel [P(W12O40)]3-
> beschrieben werden oder'.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]