pdftotext breaks sentence in middle of sentence when text overflow the box, whereas pdftohtml captures the full sentence.
Submitted by Gaurav Arora
Assigned to poppler-bugs
Created attachment 129623 sample pdf which is facing this issue
While analyzing some specific set of files, we realized that lines generated by pdftohtml and pdftotext is different where text overflows the line boundary of box.
In case of pdftohtml the line is captured normally with full text of that line in a single text element. Whereas in case of pdftotext line is broken in middle of word and the rest of line is added as a separate line.
Explanation with example below:
Line as appear in pdftohtml output:
<text top="412" left="79" width="1021" height="17" font="0">To JOSEPH E. BLUTH for research and development in the field of electronic photography and transfer of video tape to motion picture film. [Laboratory]
Line as appear in pdftotext
To JOSEPH E. BLUTH for research and development in the field of electronic photography and transfer of video tape to mo
. . . . . sfer of video tape to motion picture film. [Laboratory]
Line as it appear in pdf file:
Even though pdf file doesn't show this line correctly. pdftohtml is correctly able to get the full line, hence pdftotext can also handle and get the full line.
It seems weird for line to be broken like this. I have attached a sample pdf file which shows this bug. I have tested the the file with poppler-0.51.0
/poppler/tmp/poppler-0.51.0$ /usr/local/bin/pdftotext -v pdftotext version 0.51.0 Copyright 2005-2017 The Poppler Developers - http://poppler.freedesktop.org Copyright 1996-2011 Glyph & Cog, LLC
Attachment 129623, "sample pdf which is facing this issue":