5

I am trying to build a simple PDF/A file using the package pdfx. On Overleaf it works fine, but on my local distribution (MiKTeX 21.8), it does not work. Here is the sample file I tried to build:

\documentclass{article}
\usepackage{pdfx}
\begin{document}
Hello World!
\end{document}

This is the output on my local distribution:

This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.8) (preloaded format=pdflatex 2021.8.11)  11 AUG 2021 19:28
entering extended mode
**./teste.tex
(teste.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-07-12> (D:\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(D:\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2021/02/12 v1.4n Standard LaTeX file (size option)
)
\c@part=\count182
\c@section=\count183
\c@subsection=\count184
\c@subsubsection=\count185
\c@paragraph=\count186
\c@subparagraph=\count187
\c@figure=\count188
\c@table=\count189
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (D:\MiKTeX\tex/latex/pdfx\pdfx.sty
Package: pdfx 2019/02/27 v1.6.3 PDF/X and PDF/A support (CVR/HTH/RRM/PS)
\pdfx@minorversion=\count190

(D:\MiKTeX\tex/generic/iftex\iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
) (D:\MiKTeX\tex/generic/iftex\ifpdf.sty
Package: ifpdf 2019/10/25 v3.4 ifpdf legacy package. Use iftex instead.
) (D:\MiKTeX\tex/generic/iftex\ifxetex.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
)
(D:\MiKTeX\tex/latex/everyshi\everyshi.sty
Package: everyshi 2020/11/18 v4.00 EveryShipout Package
)
(D:\MiKTeX\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
){C:/Users/Gustavo/AppData/Local/MiKTeX/pdftex/config/pdftex.map} (D:\MiKTeX\te
x/latex/base\inputenc.sty
Package: inputenc 2021/02/14 v1.3d Input encoding file
\inpenc@prehook=\toks16
\inpenc@posthook=\toks17
)
(D:\MiKTeX\tex/latex/pdfx\l8u-penc.def
File: l8u-penc.def 2017/06/23 v0.8 Custom LaTeX file, for UTF8 encoded letters 
and symbols
LaTeX Info: Composite with undeclared \b in encoding L8U on input line 278.
)
\pdfxsafeforxmp@toks=\toks18
 (D:\MiKTeX\tex/latex/xcolor\xcolor.sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

(D:\MiKTeX\tex/latex/graphics-cfg\color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 225.

(D:\MiKTeX\tex/latex/graphics-def\pdftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
)
\pdfx@tmptoks=\toks19

(D:\MiKTeX\tex/latex/hyperref\hyperref.sty
Package: hyperref 2021-06-07 v7.00m Hypertext links for LaTeX

(D:\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(D:\MiKTeX\tex/generic/pdftexcmds\pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(D:\MiKTeX\tex/generic/infwarerr\infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(D:\MiKTeX\tex/latex/graphics\keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks20
)
(D:\MiKTeX\tex/generic/kvsetkeys\kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)
(D:\MiKTeX\tex/generic/kvdefinekeys\kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(D:\MiKTeX\tex/generic/pdfescape\pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)
(D:\MiKTeX\tex/latex/hycolor\hycolor.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
)
(D:\MiKTeX\tex/latex/letltxmacro\letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(D:\MiKTeX\tex/latex/auxhook\auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
(D:\MiKTeX\tex/latex/kvoptions\kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen139
\Hy@linkcounter=\count191
\Hy@pagecounter=\count192

(D:\MiKTeX\tex/latex/hyperref\pd1enc.def
File: pd1enc.def 2021-06-07 v7.00m Hyperref: PDFDocEncoding definition (HO)
)
(D:\MiKTeX\tex/latex/hyperref\hyperref-langpatches.def
File: hyperref-langpatches.def 2021-06-07 v7.00m Hyperref: patches for babel la
nguages
)
(D:\MiKTeX\tex/generic/intcalc\intcalc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
(D:\MiKTeX\tex/generic/etexcmds\etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count193

(D:\MiKTeX\tex/latex/hyperref\puenc.def
File: puenc.def 2021-06-07 v7.00m Hyperref: PDF Unicode definition (HO)
)
Package hyperref Info: Option `pdfa' set `true' on input line 4073.
Package hyperref Info: Hyper figures OFF on input line 4192.
Package hyperref Info: Link nesting OFF on input line 4197.
Package hyperref Info: Hyper index ON on input line 4200.
Package hyperref Info: Plain pages OFF on input line 4207.
Package hyperref Info: Backreferencing OFF on input line 4212.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4445.
\c@Hy@tempcnt=\count194
 (D:\MiKTeX\tex/latex/url\url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 4804.
\XeTeXLinkMargin=\dimen140

(D:\MiKTeX\tex/generic/bitset\bitset.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)

(D:\MiKTeX\tex/generic/bigintcalc\bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld@menulength=\count195
\Field@Width=\dimen141
\Fld@charsize=\dimen142
Package hyperref Info: Hyper figures OFF on input line 6076.
Package hyperref Info: Link nesting OFF on input line 6081.
Package hyperref Info: Hyper index ON on input line 6084.
Package hyperref Info: backreferencing OFF on input line 6091.
Package hyperref Info: Link coloring OFF on input line 6096.
Package hyperref Info: Link coloring with OCG OFF on input line 6101.
Package hyperref Info: PDF/A mode ON on input line 6104.
LaTeX Info: Redefining \ref on input line 6146.
LaTeX Info: Redefining \pageref on input line 6150.

(D:\MiKTeX\tex/latex/base\atbegshi-ltx.sty
Package: atbegshi-ltx 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
)
\Hy@abspage=\count196
\c@Item=\count197
\c@Hfootnote=\count198
)
Package hyperref Info: Driver: hpdftex.

(D:\MiKTeX\tex/latex/hyperref\hpdftex.def
File: hpdftex.def 2021-06-07 v7.00m Hyperref driver for pdfTeX

(D:\MiKTeX\tex/latex/base\atveryend-ltx.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atvery packag
e
with kernel methods
)
\Fld@listcount=\count199
\c@bookmark@seq@number=\count266

(D:\MiKTeX\tex/latex/rerunfilecheck\rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)

(D:\MiKTeX\tex/generic/uniquecounter\uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
86.
)
\Hy@SectionHShift=\skip49
)
Package hyperref Info: Option `unicode' set `true' on input line 1463.

(D:\MiKTeX\tex/generic/stringenc\stringenc.sty
Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO
)
)
Package hyperref Info: Option `psdextra' set `true' on input line 1465.

(D:\MiKTeX\tex/latex/hyperref\puenc-greekbasic.def
File: puenc-greekbasic.def 2021-06-07 v7.00m Hyperref: PDF Unicode definition (
greek block) (HO)
)
(D:\MiKTeX\tex/latex/hyperref\psdextra.def
File: psdextra.def 2021-06-07 v7.00m Hyperref: Additions to PDF string support
)
(D:\MiKTeX\tex/generic/colorprofiles\colorprofiles.sty
Package: colorprofiles 2018/11/01 v1.0.1 color profiles for PDF/X and PDF/A sup
port

(D:\MiKTeX\tex/generic/colorprofiles\colorprofiles.tex))
(D:\MiKTeX\tex/generic/stringenc\se-pdfdoc.def
File: se-pdfdoc.def 2019/11/29 v1.12 stringenc: PDFDocEncoding
)
(D:\MiKTeX\tex/latex/pdfx\AdobeColorProfiles.tex)
(D:\MiKTeX\tex/latex/pdfx\8bit.def
File: 8bit.def 2008/03/30 v1.1d Input encoding file
)
** pdfx: No file teste.xmpdata . Metadata will be incomplete!
<<sRGB.icc>> (D:\MiKTeX\tex/latex/pdfx\8bit.def
File: 8bit.def 2008/03/30 v1.1d Input encoding file
)
Package hyperref Info: Option `unicode' set `true' on input line 2411.
Package hyperref Info: Option `unicode' set `true' on input line 2412.

(D:\MiKTeX\tex/generic/pdftex\glyphtounicode.tex)
(D:\MiKTeX\tex/latex/pdfx\glyphtounicode-cmr.tex)
(D:\MiKTeX\tex/latex/pdfx\glyphtounicode-ntx.tex)
(D:\MiKTeX\tex/latex/base\ifthen.sty
Package: ifthen 2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)
) (D:\MiKTeX\tex/latex/xmpincl\xmpincl.sty
Package: xmpincl 2008/05/10 v2.2 Include XMP data in pdflatex
) (D:\MiKTeX\tex/latex/pdfx\8bit.def
File: 8bit.def 2008/03/30 v1.1d Input encoding file
)
Using XMP template file: pdfa.xmp
\xmpinclWrite=\write3
\xmpinclRead=\read2
\openout3 = `pdfa.xmpi'.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.2855  \includexmp{\xmp@template}
                                  %
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

If I type to proceed, it just keeps repeating the same error over and over again:

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.2855  \includexmp{\xmp@template}
                                  %
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

If this is a commmon issue, I may report a bug to them. Otherwise I may try to reinstall my distribution (which is awful because it is a full installation)

1
  • 2
    It is a bug in pdf and reinstalling MiKTeX will not help. The author knows about it since a number of weeks but I don't know when he will update. Aug 12 '21 at 7:12
3

Update

With xmpincl 2021/08/31 v2.3 this patch is no longer needed


You can try this patch:

\documentclass{article}

\usepackage{etoolbox}
\makeatletter
\@ifl@t@r\fmtversion{2021-06-01}%
 {\AddToHook{package/after/xmpincl}
   {\patchcmd\mcs@xmpincl@patchFile{\if\par}{\ifx\par}{}{\fail}}}{}
\makeatother
\usepackage{pdfx}
\begin{document}
Hello World!
\end{document}

Not the answer you're looking for? Browse other questions tagged or ask your own question.