Okular - Printing bug?

Greetings, this might be a duplicate of this bug report but the reported case seems slightly different from mine and I wasn’t sure if this behaviour is intended or not. Please, let me know.

Recently I’ve tried to print a booklet that I made using pdfbook2 out of a XeLaTeX PDF made with pandoc. I’m having issue with the initial that use the GoudyIn font displayed as following:

The problem is that, when I try to print it (Only when using Okular, I have not found this problem using QPDFView for example), the initial is rendered as a simple L whilst in the print preview everything seems correct.
I have then tried to print to a PDF file and I actually got a PDF with the initial rendered equal as it was printed:

(This problem obviously does not occur if, when meddling in the printing option’s window, I force the transformation into image beforehand. But I found out this at the end of this little inquiry.)

I then tried with other software like Evince but, with the same printing option as Okular, the rendering of the PDF file was correct. The only difference that I could make of it is that Okular produces (Or, at least, that’s what is stated in the metadata) the PDF using GPL Ghostscript 10.02.1 whilst Evince uses cairo 1.18.0.

At the start I have stated that the booklet was created via pdfbook2 because I didn’t encounter this problem with the normal pandoc PDF even using Okular so I thought this might had something to do with this problem.

So should this be treated as a different bug? In that case I would gladly report it myself. Although the first one that I reported at the start seems still pending despite the merge request.

In any case, thanks for the attention.

Go to Settings → Configure Backends, then on Ghostcript and uncheck the Use platform fonts and see if that fixes the issue.

If it doesn’t fix it, then I guess you need to dig deeper into ghostscript configuration but I can’t help you with that. I just recalled this from the pre unicode times, when I was trying to print pdf files with greek text :roll_eyes:

I thank you Mr. Salatas, I have promptly tried as suggested unfortunately the results didn’t differ neither for the Print to PDF nor for the actual printing.

When you install LaTeX, it comes with its own and extra fonts installed in particular locations (e.g /usr/share/texmf-dist/) that are only accessed by PdfLaTex, XeLaTeX… compilers, so when you produce your final PDF file, you should check that all your used fonts are truly embedded inside it, so that any PDF viewer or printer can produce the correct rendering.

Yes, indeed. But I thought the embedding was a given since is a problem that only occurs using Okular and not the other PDF viewers that I’ve mentioned (If it was a embedding problems I think that in that case I would have seen the same behaviour regardless of the PDF Viewer used, but of course I might be wrong). In any case Okular reports the incriminated font as embedded and this is, just as a hopefully conclusive proof, the result of pdffonts:

name type encoding emb sub uni object ID
AIRXUR+GoudyInitialen Type 1 Custom yes yes yes 14 0

So the font is embedded, or better its subset is.

All of Okular, Evince and QPdfView use poppler library to render PDF files.

Can you post a minimal PDF file?

I tested with EB Garamond Initial, and initials seem to render correctly inside Okular, and printing to PDF file also export them with correct shapes.

Well, I do apologize, I have no clue why this happen then.

I would gladly post the PDF, what would the advised way to do so be?

The strange thing is that I also do not encounter this problem, neither the printed to PDF nor the actually printed, with the original XeLaTeX PDF made with pandoc but just with the booklet made using pdfbook2 with Okular…

I tried to replicate your scenario, and it seems there’s a problem with that PDF virtual printer.

I compiled a simple .tex using PdfLateX compiler:

\documentclass{article}

\usepackage{lettrine}
\usepackage{GoudyIn}
\renewcommand{\LettrineFontHook}{\GoudyInfamily{}}
\begin{document}
	\Huge \lettrine{H}{ello world}
\end{document}

Then I got the output PDF with subset of the font embedded:

Then I printed that file using the PDF virtual printer:

So the embedded subset of font was removed, and now it’s substituted by a random font.

If I download Goudy Initialen Font and put it in ~/.local/share/fonts/GoudyInitialen folder then run fc-cache -fv, that file will correctly render

I believe it’'s the same issue as the bug report mentioned in the first comment.

1 Like

@jsalatas Yeah, you are right, it seems Okular need to update its printing mechanism, because the age of postscript printing is gone, and now every printer can directly handle PDF files.

@jsalatas @medin I thank both of you very much for the support, the problem was solved. The printed to PDF version still loses memory of the initial font (In fact the source file in my case weights 34 kb whilst the printed just 10 kb) and the Dolphin thumbnail shows the wrong Initial but now at least, when opened in Okular, the initial is correct as the actually printed version.