Gábor Stefanik created PDFBOX-5125:
--------------------------------------

             Summary: 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
         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-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to