Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX warning: multiple pdfs w ith page group included in a single page #662

Open
mgeier opened this issue Aug 25, 2022 · 0 comments
Open

Comments

@mgeier
Copy link
Member

mgeier commented Aug 25, 2022

Other latex warnings:

[25 <./python_logo.pdf> <./main-logo.pdf

pdfTeX warning: pdflatex (file ./main-logo.pdf): PDF inclusion: multiple pdfs w
ith page group included in a single page
> <./fe1ba2728605169d4270646e0702b6ef37f4aad5.png>] [26 <./6e42ca0abdf1647b0e5b
794e9605d81a09e28d28.png>] [27]

But I guess the "multiple pdfs" are python_logo.pdf and main-logo.pdf (which are auto-generated from SVG files with rsvg-convert).

Maybe the converter settings could be changed to avoid this?

Do you know what "with page group" means?

I did not as I don't practice graphics inclusions often enough... turns out this tex.sx question i.e. https://tex.stackexchange.com/questions/76273/multiple-pdfs-with-page-group-included-in-a-single-page-warning has by luck some quite informative answer.

So whenever you include 2 pdfs in the same page you may encounter the problem, depending how the pdf's were produced... one gets indeed the warning from using

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\noindent\includegraphics{{python_logo}.pdf}

\noindent\includegraphics{{main-logo}.pdf}

\end{document}

test file (refereed to as testincludegraphics.tex below).

I tested that adding

\ifdefined\pdfsuppresswarningpagegroup
   \pdfsuppresswarningpagegroup=1 % cf https://tex.stackexchange.com/a/78020
\fi

does let the warning go away. It seems from some other answers at the tex.sx question that although PDFTeX does a bad job at emitting most of the time the warning for no real reason in some cases though the output has problems and warning is justified.

I tested with luatex and there seems to be no warnings with my test file. I then made the mistake to test above file with xetex (xelatex testincludegraphics) and

xdvipdfmx:fatal: pdf_link_obj(): passed invalid object.

No output PDF file written.
(see the transcript file for additional information)
Error 256 (driver return code) generating output;
file testincludegraphics.pdf may not be valid.
Transcript written on testincludegraphics.log.

This already happens with the above test file reduced to trying to include either one of the two files so is another issue.

Sorry for gory details, I hate this too, but only to be complete

  • $ ps2pdf main-logo.pdf produces a file main-logo.pdf.pdf which I can use (alone) in my test file above with xelatex and produced pdf seems to be fine (trying main-logo.pdf leads to above build error)
  • but attempting executing ps2pdf (which invokes the ghostscript toolchain and which I use sometimes to reduce pdf sizes) python-logo.pdf gives
$ ps2pdf python_logo.pdf
   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.
   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.
   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.
   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.

However, then xelatex does not complain with \includegraphics{{python_logo.pdf}.pdf}.

Anyway it looks as if something is fishy with file python_logo.pdf at least Ghostscript complains.

And a xelatex run breaks with error status 1 when one tries to use \includegraphics{{python_logo}.pdf}.

Sorry for long, I hate this too when it turns out this way (and I will not try to report this "upstream"). As has been recently aptly commented by some passer-by:

You guys are doing some crazy work there. But is this not insane? Are there no proper solutions to getting SVGs into PDFs in freakin' 2022?

Originally posted by @jfbu in #657 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant