git.iko.soy/typeable/pandoc
on master help sign in
ConTeXt template: pdfa variable to generate PDF/A (#4294)

The resulting PDF can be verified using the Apache PDFBox preflight app. ``` $ java -jar preflight-app-2.0.8.jar test.pdf The file test.pdf is a valid PDF/A-1b file ``` Instructions on how to install the ICC profiles on ConTeXt standalone can be found in the wiki: <http://wiki.contextgarden.net/PDFX#ICC_profiles>. If the ICC profiles are not available the log will contain messages like these ``` backend > profiles > profile specification 'sRGB.icc' loaded from '/usr/local/texlive/2017/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'srgb.icc' backend > profiles > no default profile 'srgb.icc' for colorspace 'rgb' backend > profiles > profile specification 'sRGB IEC61966-2.1' loaded from '/usr/local/texlive/2017/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml' backend > profiles > error, couldn't locate profile 'srgb.icc' backend > profiles > invalid output intent 'sRGB IEC61966-2.1' ``` and the resulting PDF will not be valid PDF/A: ``` $ java -jar preflight-app-2.0.8.jar test.pdf The file test.pdf is not a valid PDF/A-1b file, error(s) : 2.4.3 : Invalid Color space, The operator "g" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, The operator "G" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, The operator "g" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, The operator "G" can't be used without Color Profile on page 1 2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1 ``` However, the PDF will still be generated and the "errors" shown in the log do not break anything.

commit46f4238a2a40b5542612bc745e63ce503ce12a32 authorHenri Menke <henri@icp.uni-stuttgart.de> dateSun 18 Mar 2018, 17:05 (9 years ago) parent155a2ac
2 files changed+17
MANUAL.txt+10 data/templates/default.context+7
MANUAL.txt+10
@@ -1624,12 +1624,22 @@ Variables for ConTeXt
16241624`lof`, `lot`
16251625: include list of figures, list of tables
16261626
1627+`pdfa`
1628+: adds to the preamble the setup necessary to generate PDF/A-1b:2005.
1629+ To successfully generate PDF/A the required ICC color profiles have to
1630+ be available and the content and all included files (such as images)
1631+ have to be standard conforming. The ICC profiles can be obtained
1632+ from [ConTeXt ICC Profiles]. See also [ConTeXt PDFA] for more
1633+ details.
1634+
16271635[ConTeXt Paper Setup]: http://wiki.contextgarden.net/PaperSetup
16281636[ConTeXt Layout]: http://wiki.contextgarden.net/Layout
16291637[ConTeXt Font Switching]: http://wiki.contextgarden.net/Font_Switching
16301638[ConTeXt Color]: http://wiki.contextgarden.net/Color
16311639[ConTeXt Headers and Footers]: http://wiki.contextgarden.net/Headers_and_Footers
16321640[ConTeXt Indentation]: http://wiki.contextgarden.net/Indentation
1641+[ConTeXt ICC Profiles]: http://wiki.contextgarden.net/PDFX#ICC_profiles
1642+[ConTeXt PDFA]: http://wiki.contextgarden.net/PDF/A
16331643[`setupwhitespace`]: http://wiki.contextgarden.net/Command/setupwhitespace
16341644[`setupinterlinespace`]: http://wiki.contextgarden.net/Command/setupinterlinespace
16351645[`setuppagenumbering`]: http://wiki.contextgarden.net/Command/setuppagenumbering
data/templates/default.context+7
@@ -38,6 +38,13 @@ $endif$
3838$if(pagenumbering)$
3939\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]
4040$endif$
41+$if(pdfa)$
42+% attempt to generate PDF/A
43+\setupbackend
44+ [format=PDF/A-1b:2005,
45+ intent=sRGB IEC61966-2.1,
46+ profile=sRGB.icc]
47+$endif$
4148
4249% use microtypography
4350\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]