# Multiple pdfs with page group included in a single page warning

I updated TexLive to the Ubuntu Quantal version (2012.20120611-4) and I suddenly got this warning:

PDF inclusion: multiple pdfs with page group included in a single page


This is a minimal example for which I get the warning:

\documentclass{book}
\usepackage{graphicx}
\begin{document}
\includegraphics{image1}

\includegraphics{image2}
\end{document}


Both images have been produced by the export PDF feature of Inkscape and contain simple line drawings (no fancy stuff).

I have been looking on the Internet, but only found others with this problem and did not found any solutions:

• In the Latex user group they did not seem to understand/recognise the problem. And told the OP to go to the MikTeX groups, but it is not a MikTeX specific problem as it is also happening with TexLive and other distributions
• At gmane.comp.tex.pdftex they were looking into the use (and versions) of MS Office products. Also not the cause as I am not using MS Office to produce PDFs.

During my search if found the pdftex code (pdftoepdf.cc) that spawns this warning, maybe it is of some help in understanding what is happening?

if (pdfpagegroupval == 0) {
// another pdf with page group was included earlier on the same page;
// copy the Group entry as is
pdftex_warn("PDF inclusion: multiple pdfs with page group included in a single page");
pdf_newline();
pdf_puts("/Group ");
copyObject(&dictObj);
} else {
// write Group dict as a separate object, since the Page dict also refers to it
pageDict->lookup((char *) "Group", &dictObj);
if (!dictObj->isDict())
pdftex_fail("PDF inclusion: /Group dict missing");
writeSepGroup = true;
initDictFromDict(groupDict, page->getGroup());
pdf_printf("/Group %d 0 R\n", pdfpagegroupval);
}


Does anyone have an idea what is happening, whether it is serious and how I could get rid of these warnings?

-
"I have been looking on the Internet, but only found others with this problem." Some links could be useful. –  lockstep Oct 11 '12 at 8:40
@lockstep sorry I forgot. I have updated my question showing the two of this discussions going nowhere. –  Veger Oct 11 '12 at 9:07

The problem is also reported in a german forum mrunix.de. It might be a bug in the tex distribution (pdftex). The problem happens only when you include multiple pdf pages, created in a specific manner (e.g. by MS Office products), in a single page.

Solution: Convert pdf files into ps and then back to pdf using Ghostscript, then the warning will go away (pdf2ps -> ps2pdf). This conversion probably removes the "page group" information from pdf files.

Editing the colorspace of pdf files with ghostscript also resolves the issue (if there is no multiple pages in the pdf file):

gs -o image.pdf -sDEVICE=pdfwrite -dColorConversionStrategy=/sRGB
-dProcessColorModel=/DeviceRGB image.pdf


CMYK conversion if RGB does not work for you:

gs -o image.pdf -sDEVICE=pdfwrite -dColorConversionStrategy=/CMYK
-dProcessColorModel=/DeviceCMYK image.pdf


P.S. Some programs generate "page group"s in pdf files; for example when you impose different images/objects in illustrator or inkscape. It seesm that pdftex is unable to handle multiple page groups in a single output page. The reason might be that each page groups specifies a different color space or transparency space.

-
Thank you for your explanation and solution, it works. Minor disadvantage of pdf2ps -> ps2pdf: the text in my PDF figures is not text anymore (ie it is not selectable), so I need to go and find another solution to remove the 'page groups' –  Veger Oct 17 '12 at 13:07
Your ghostscript conversion method works better! Thanks again –  Veger Oct 18 '12 at 6:58
Your gs command entirely screwed up my PDF images. –  Dominique May 2 at 20:20
@Dominique, What happened to your images? The command works for me. You may cosnider converting to another colorspace if RGB does not work for you. –  Aydin May 7 at 10:38

PDF has a feature called "Page Groups" (PDF Reference, section 11.4.7). These descibe transparency effects between top-level objects on one page. When pdfTeX (or LuaTeX or XeTeX) includes a page from a PDF, it converts all pages into "Form XObjects" (section 8.10.1). pdfTeX also converts the Page Groups into /Group entries of the XObjects.

The problem now is that Adobe products need also a /Group entry in the /Page object which contains these XObjects to correctly render transparency. pdfTeX will either use the first one it encounters when including PDFs or synthesize one when including PNGs with transparency. The warning is triggered when multiple Page Groups are encountered on one page and can probably be ignored. Of course this should be described somewhere in the pdfTeX documentation...

-
Thanks for your extensive explanation, it clarifies a lot! –  Veger Oct 17 '12 at 13:08

Additional Info / Workaround for MS Office Users: I have been using pdfLaTeX with PDFs generated from Visio for years. I just reinstalled my PC and then I got the warning - but only for NEWLY saved PDFs, not for the old ones. Therefore I looked for PDF options in Visio: If you tell Visio to generate PDF/A compatible PDFs, the warning will disappear.

-