CMap issue in PDF file generated with recent TeX Live + Ghostscript

Vincent Lefevre vincent at vinc17.net
Thu Oct 14 13:30:08 CEST 2021


Hi,

After generating a PDF file with pdflatex, I usually run ps2pdf
(from Ghostscript) to make the PDF much smaller (thanks to the
font conversion from Type 1 to Type 1C).

While there were no issues with TeX Live up to 2020, CMap gets
broken when the original PDF file has been obtained with a recent
TeX Live version.

For instance, consider the following .tex file:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
\thispagestyle{empty}
Test: « don't finite float offer affine ».
\end{document}

I've attached 4 PDF files:
  * chartest5a-2020.pdf generated by pdflatex with
    texlive 2020.20210202-3 under Debian/unstable;
  * chartest5a-2021.pdf generated by pdflatex with
    texlive 2021.20210921-1 under Debian/unstable;
  * out-2020.pdf: generated from chartest5a-2020.pdf with ps2pdf;
  * out-2021.pdf: generated from chartest5a-2021.pdf with ps2pdf.

The ps2pdf script actually runs:

  /usr/bin/gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile=out-2020.pdf -P- -dSAFER -dCompatibilityLevel=1.4 chartest5a-2020.pdf

and

  /usr/bin/gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile=out-2021.pdf -P- -dSAFER -dCompatibilityLevel=1.4 chartest5a-2021.pdf

While the chartest5a-*.pdf files seem fine, pdftotext gives the
following output on the out-*.pdf files:

out-2020.pdf
  Test: « don’t finite float offer affine ».

out-2021.pdf
  Test: ń donŠt Ąnite Ćoat offer affine ż.

So out-2020.pdf is correct, but out-2021.pdf is not.

Note that in both cases, the Ghostscript version is the same (9.53.3,
but there is the same issue for this testcase with Ghostscript 9.54).
Thus the different behavior comes from the difference between the
TeX Live versions.

What is causing this difference? Is this a bug in TeX Live, or only
in Ghostscript?

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chartest5a-2020.pdf
Type: application/pdf
Size: 24331 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20211014/ccda85bf/attachment-0004.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chartest5a-2021.pdf
Type: application/pdf
Size: 25273 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20211014/ccda85bf/attachment-0005.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out-2020.pdf
Type: application/pdf
Size: 5606 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20211014/ccda85bf/attachment-0006.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out-2021.pdf
Type: application/pdf
Size: 5990 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20211014/ccda85bf/attachment-0007.pdf>


More information about the tex-live mailing list.