[pdftex] pdflatex adds spaces between letters, which makes search impossible

Allin Cottrell cottrell at wfu.edu
Fri Dec 6 02:52:50 CET 2019


On Fri, 6 Dec 2019, Olivier via pdftex wrote:

> Hello,
>
> [sorry, I couldn't find a website where I could search through the past 
> discussions to check if that question was already submitted to the list]
>
> My problem is that PDF files produced by `pdflatex` are not searchable with 
> `mupdf`. Considering such file named "test.pdf", we have the result below, 
> which explains why searching for the string "lorem" fails:
>
> $ mutool draw -F txt test.pdf | head -1
> Lor e m
>
> It is observed that spaces are added arbitrarily between the letters.

But who's adding them? I don't have the "lmodern" (font) package 
installed, but if I run pdflatex on a PDF generated as you describe 
except for the omission of "\usepackage{lmodern}", then

pdftotext test.pdf - | grep lorem

displays the expected results, with intact "lorem"s.

Allin Cottrell


More information about the pdftex mailing list