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 2021/03/09 06:19:00 UTC

[jira] [Commented] (PDFBOX-5125) Slightly slanted line with right side higher than the left confuses PDFTextStripper with sortByPosition=true

    [ https://issues.apache.org/jira/browse/PDFBOX-5125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297848#comment-17297848 ] 

Tilman Hausherr commented on PDFBOX-5125:
-----------------------------------------

You could try the "rotationMagic" feature of the ExtractText tool, I get this:

„Nyomat előállító eszközök szállítása és kapcsolódó szolgáltatások 2013”
tárgyban lefolytatott központosított közbeszerzési keretmegállapodásos eljárás 2. része
(Általános Multifunkciós eszközök) eredményeképpen a Beszerző és Eladó között
keretmegállapodás jött létre (továbbiakban: KM).


> Slightly slanted line with right side higher than the left confuses PDFTextStripper with sortByPosition=true
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5125
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5125
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 2.0.22
>            Reporter: Gábor Stefanik
>            Priority: Major
>         Attachments: BB-8541-1-ocr.pdf
>
>
> The attached PDF, when run through PDFTextStripper with sortByPosition=true, yields improperly ordered text: the beginnings of lines are printed after the ends of the same lines, after a superfluous linebreak. There are also some additional erroneous linebreaks that do not result in the text reversing, like the one in "keretmegállapodásos".
> PDFBox extracts:
> {noformat}
> lőállító eszközök szállítása és kapcsolódó szolgáltatások 2013”
> „Nyomat e
> árgyban lefolytatott központosított közbeszerzési keretmegállapodáso
> s eljárás 2. része
> t
> (Általános Multifunkciós eszközök) eredményeképpen a Beszerző és El
> adó között
> keretmegállapodás jött létre (továbbiakban: KM).{noformat}
> The same PDF opened in Adobe Reader, and all the text in it copied out:
> {noformat}
> „Nyomat előállító eszközök szállítása és kapcsolódó szolgáltatások 2013”
> tárgyban lefolytatott központosított közbeszerzési keretmegállapodásos eljárás 2. része
> (Általános Multifunkciós eszközök) eredményeképpen a Beszerző és Eladó között
> keretmegállapodás jött létre (továbbiakban: KM).{noformat}
> (The word "teljesítése" is missing in both extractions due to an OCR error; that's an issue with Tesseract an unrelated to this issue.)
> In Firefox (pdf.js), we get:
> {noformat}
> „Nyomatelőállítóeszközökszállításaés kapcsolódószolgáltatások2013”tárgybanlefolytatottközpontosítottközbeszerzésikeretmegállapodásoseljárás2.  része(ÁltalánosMultifunkcióseszközök)eredményeképpena  Beszerzőés  Eladóközöttkeretmegállapodásjöttlétre(továbbiakban:KM).{noformat}
> (The missing spaces are a well-known incompatibility between Tesseract 4.0 and pdf.js, workarounded in Tesseract 4.1, but the order of the text remains correct.)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org