Discussion:
XeTeX cannot deal with pdf v1.6
Joseph LEE
2008-05-26 06:07:01 UTC
Permalink
Hi All

These days I need to extract a page in one pdf file (v1.4) and insert it
into a tex document in graphics style. But the Acrobat 8 would rise the
version of extracted page to v1.6.

With the simplest source:

\documentclass[a4paper]{article}
\usepackage{graphicx,color}
\begin{document}
\resizebox{\textwidth}{!}{\includegraphics{5.pdf}}%5.pdf is pdf v1.6
\end{document}

The XeLaTeX warns and could not output any page

** WARNING ** Couldn't open font map file "psbase14.map".
** WARNING ** Couldn't open font map file "pdfmfnt.map".
** WARNING ** Version of PDF file (1.6) is newer than version limit
specification.
'gswin32c' is not recognized as an internal or external command,
operable program or batch file.
** WARNING ** Filtering file via command -->gswin32c -q -dSAFER
-dNOPAUSE -dBATC
H -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-dAutoFilterGrayImag
es=false -dAutoFilterColorImages=false -dGrayImageFilter=/FlateEncode
-dColorIma
geFilter=/FlateEncode -dUseFlateCompression=true
-sOutputFile=C:/DOCUME~1/JOSEPH
~1/LOCALS~1/Temp/dvipdfmx.b02256 -c .setpdfwrite -f ./5.pdf -c quit<--
failed.
** WARNING ** Image format conversion for "./5.pdf" failed...
** WARNING ** Image width=0.0!
** WARNING ** Image height=0.0!
** ERROR ** pdf_ref_obj(): passed invalid object.

Output file removed.

Error 1 (driver return code) generating output;
file test.pdf may not be valid.
Transcript written on test.log.

While pdfLaTeX could roughly process it with warning and give a pdf file.

pdfTeX warning: pdflatex.exe (file ./5.pdf): PDF inclusion: found PDF
version <1.6>, but at most version <1.4> allowed.

As I have to use fontspec in my main document, replacing XeLaTeX with
pdfLaTeX can not be a solution. Nowadays, I have to conver pdf into
separated PNG files and suffer the low resolution of bitmap.

How can I resolve this problem or just waiting for the update of XeTeX?
--
Yours, Sincerely

Joseph LEE
Ulrike Fischer
2008-05-26 16:11:22 UTC
Permalink
Post by Joseph LEE
Hi All
These days I need to extract a page in one pdf file (v1.4) and insert it
into a tex document in graphics style. But the Acrobat 8 would rise the
version of extracted page to v1.6.
\documentclass[a4paper]{article}
\usepackage{graphicx,color}
\begin{document}
\resizebox{\textwidth}{!}{\includegraphics{5.pdf}}%5.pdf is pdf v1.6
\end{document}
The XeLaTeX warns and could not output any page
** WARNING ** Couldn't open font map file "psbase14.map".
** WARNING ** Couldn't open font map file "pdfmfnt.map".
** WARNING ** Version of PDF file (1.6) is newer than version limit
specification.
'gswin32c' is not recognized as an internal or external command,
operable program or batch file.
** WARNING ** Filtering file via command -->gswin32c -q -dSAFER
-dNOPAUSE -dBATC
H -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-dAutoFilterGrayImag
es=false -dAutoFilterColorImages=false -dGrayImageFilter=/FlateEncode
-dColorIma
geFilter=/FlateEncode -dUseFlateCompression=true
-sOutputFile=C:/DOCUME~1/JOSEPH
~1/LOCALS~1/Temp/dvipdfmx.b02256 -c .setpdfwrite -f ./5.pdf -c quit<--
failed.
** WARNING ** Image format conversion for "./5.pdf" failed...
** WARNING ** Image width=0.0!
** WARNING ** Image height=0.0!
** ERROR ** pdf_ref_obj(): passed invalid object.
Output file removed.
Error 1 (driver return code) generating output;
file test.pdf may not be valid.
Transcript written on test.log.
While pdfLaTeX could roughly process it with warning and give a pdf file.
pdfTeX warning: pdflatex.exe (file ./5.pdf): PDF inclusion: found PDF
version <1.6>, but at most version <1.4> allowed.
As I have to use fontspec in my main document, replacing XeLaTeX with
pdfLaTeX can not be a solution. Nowadays, I have to conver pdf into
separated PNG files and suffer the low resolution of bitmap.
How can I resolve this problem or just waiting for the update of XeTeX?
You could try to change the version setting in dvipdfmx.cfg:

%% PDF Version Setting
%%
%% PDF (minor) version stamp to use in output file.
%% This also implies maximal version of PDF file allowed to be included.
%% Dvipdfmx does not support 1.0, 1.1, 1.2 since TrueType font embedded
%% as CIDFontType2 requires at least version 1.3. Transparent imaging
%% model requires version 1.4. So if you want soft-masking support for
%% PNG image with alpha channels, you should set version to 4 or higher.

V 4


pdftex has a similar configuration value. See the pdftex manual.
--
Ulrike Fischer
Jonathan Kew
2008-05-26 16:14:11 UTC
Permalink
Hi Joseph,

Several comments that might help....
Post by Joseph LEE
Hi All
These days I need to extract a page in one pdf file (v1.4) and
insert it
into a tex document in graphics style. But the Acrobat 8 would rise the
version of extracted page to v1.6.
\documentclass[a4paper]{article}
\usepackage{graphicx,color}
\begin{document}
\resizebox{\textwidth}{!}{\includegraphics{5.pdf}}%5.pdf is pdf v1.6
\end{document}
The XeLaTeX warns and could not output any page
** WARNING ** Couldn't open font map file "psbase14.map".
** WARNING ** Couldn't open font map file "pdfmfnt.map".
These warnings may not be directly relevant here, but they sound like
there's a config problem with xdvipdfmx. Are you running a very
recent update? If so, you may need to move the dvipdfmx.cfg file from
(SOMEWHERE)/texmf/dvipdfm to (SOMEWHERE)/texmf/dvipdfmx, to match
recent changes in the dvipdfmx and xdvipdfmx drivers.

(And if you do copy/move such a file, remember to update the TeX
filename databases using texhash or the MikTeX equivalent... you
didn't specify exactly what TeX system you're using.)
Post by Joseph LEE
** WARNING ** Version of PDF file (1.6) is newer than version limit
specification.
You can try changing the PDF version setting in the config file; see
the "V" entry, probably the first option that's specified in
dvipdfmx.cfg if yours looks anything like mine. You can change it
from "4" to "6" to suppress this warning.
Post by Joseph LEE
'gswin32c' is not recognized as an internal or external command,
operable program or batch file.
** WARNING ** Filtering file via command -->gswin32c -q -dSAFER
-dNOPAUSE -dBATC
H -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
-dAutoFilterGrayImag
es=false -dAutoFilterColorImages=false -dGrayImageFilter=/FlateEncode
-dColorIma
geFilter=/FlateEncode -dUseFlateCompression=true
-sOutputFile=C:/DOCUME~1/JOSEPH
~1/LOCALS~1/Temp/dvipdfmx.b02256 -c .setpdfwrite -f ./5.pdf -c quit<--
failed.
** WARNING ** Image format conversion for "./5.pdf" failed...
** WARNING ** Image width=0.0!
** WARNING ** Image height=0.0!
** ERROR ** pdf_ref_obj(): passed invalid object.
Here, xdvipdfmx is trying to use Ghostscript to convert the image
format. I think it's doing that to try and re-encode it as PDF 1.4;
but GS apparently isn't installed or isn't found on your system.
Result: it ends up without a usable file.

Changing the PDF version # in the config file may stop it from trying
to do this, and allow you to include the page directly.

JK
Bruno Voisin
2008-05-29 14:33:23 UTC
Permalink
Post by Jonathan Kew
These warnings may not be directly relevant here, but they sound like
there's a config problem with xdvipdfmx. Are you running a very
recent update? If so, you may need to move the dvipdfmx.cfg file from
(SOMEWHERE)/texmf/dvipdfm to (SOMEWHERE)/texmf/dvipdfmx, to match
recent changes in the dvipdfmx and xdvipdfmx drivers.
(And if you do copy/move such a file, remember to update the TeX
filename databases using texhash or the MikTeX equivalent... you
didn't specify exactly what TeX system you're using.)
Compiling xetex from the latest source (revision 709 -- I'm seeing
that 39 seconds ago Jonathan created revision 710) and using xetex +
xdvipdfmx yields the warning:

** WARNING ** Could not open config file "dvipdfmx.cfg".

Based on the above, I copied (for Mac OS X)

/usr/local/texlive/2007/texmf-config/dvipdfm/config/dvipdfmx.cfg

to

/usr/local/texlive/texmf-local/dvipdfmx/config/dvipdfmx.cfg

and indeed the problem disappears.

Shouldn't this change be included in the source tree (namely patching
TeXlive by providing dvipdfmx.cfg in dvipdfmx/config/ instead of
dvipdfm/config/)?

Bruno Voisin

Bruno Voisin
2008-05-26 16:19:36 UTC
Permalink
Post by Joseph LEE
These days I need to extract a page in one pdf file (v1.4) and
insert it
into a tex document in graphics style. But the Acrobat 8 would rise the
version of extracted page to v1.6.
Did you try the pdfpages package? It might do what you're looking for
(and is compatible with XeTeX).

Bruno Voisin
Adam Twardoch
2008-05-26 16:46:33 UTC
Permalink
I use http://www.accesspdf.com/pdftk/ for splitting PDFs.

A.
--
Adam Twardoch
| Language Typography Unicode Fonts OpenType
| twardoch.com | silesian.com | fontlab.net
Mojca Miklavec
2008-05-26 19:53:56 UTC
Permalink
Post by Joseph LEE
Hi All
These days I need to extract a page in one pdf file (v1.4) and insert it
into a tex document in graphics style. But the Acrobat 8 would rise the
version of extracted page to v1.6.
If you're using Acrobat for extracting pages, you can just as well
save the document in a lower pdf version (from version 1.3 up).

See
Advanced/PDF optimizer.../Make compatible with:

But of course you can (as others have already suggested):
- use other free tools to extract pages
- use package that is able to extrat a specific page for you when
including that page into the document (pdfpages?)

Mojca
Joseph LEE
2008-05-27 05:56:27 UTC
Permalink
Dear Jonathan Kew

With method (replacing dvipdfmx/config/dvipdfmx.cfg with
dvipdfm/dvipdfmx.cfg) I have solved this problem, although a small
deficit exists: the xelatex report

** WARNING ** << /Rotate 90 >> found. (Not supported yet)

and the .pdf image included in .tex was rotated 90 degree. This error
also occurred while I reduce the pdf version from 1.6 to 1.4.
--
Yours, Sincerely

Joseph LEE
Jonathan Kew
2008-05-27 08:22:14 UTC
Permalink
Post by Joseph LEE
Dear Jonathan Kew
With method (replacing dvipdfmx/config/dvipdfmx.cfg with
dvipdfm/dvipdfmx.cfg) I have solved this problem, although a small
deficit exists: the xelatex report
** WARNING ** << /Rotate 90 >> found. (Not supported yet)
and the .pdf image included in .tex was rotated 90 degree. This error
also occurred while I reduce the pdf version from 1.6 to 1.4.
Yes - sorry, (x)dvipdfmx does not currently support page rotation in
the PDF it is embedding.

You can rotate images with the \includegraphics command at the time
of placing them in xelatex; this should work. But I'm not sure if the
page rotation in your PDF itself will lead to incorrect scaling/
positioning, depending whether this is taken into account when the
image is measured for layout (as opposed to embedded by the driver).

JK
Loading...