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

ConTeXt writer: attempt to generate PDF/A #4294

Merged
merged 5 commits into from
Mar 18, 2018
Merged

ConTeXt writer: attempt to generate PDF/A #4294

merged 5 commits into from
Mar 18, 2018

Conversation

hmenke
Copy link
Contributor

@hmenke hmenke commented Jan 23, 2018

Adresses #3215


As a demo I used this minimal markdown example:

# First section

Hello World!

I generated ConTeXt source using

pandoc -f markdown -t context -s -o test.tex test.md

and produced a PDF using ConTeXt standalone with the required ICC profiles installed. 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

but the PDF will still be generated and the "errors" shown in the log do not break anything.

@jgm
Copy link
Owner

jgm commented Jan 24, 2018

Would it be cleaner to make this conditional on the pdfa variable?

@hmenke
Copy link
Contributor Author

hmenke commented Jan 24, 2018

That is a good idea. I also added some docs.

@jgm jgm merged commit 46f4238 into jgm:master Mar 18, 2018
@wilx
Copy link
Contributor

wilx commented Mar 18, 2018

What colour profile it is looking for?

@wilx
Copy link
Contributor

wilx commented Mar 18, 2018

sRGB? Can't we ship sRGB profile from http://www.color.org/srgbprofiles.xalter? It seems to have very permissive license:

To anyone who acknowledges that the file "sRGB_v4_ICC_preference.icc" is provided "AS IS" WITH NO EXPRESS OR IMPLIED WARRANTY, permission to use, copy and distribute this file for any purpose is hereby granted without fee, provided that the file is not changed including the ICC copyright notice tag, and that the name of ICC shall not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. ICC makes no representations about the suitability of this software for any purpose.

@jgm
Copy link
Owner

jgm commented Mar 18, 2018

I'd rather not get into the business of distributing such files with pandoc, even if the licensing terms allow it.

@hmenke
Copy link
Contributor Author

hmenke commented Mar 18, 2018

@wilx I have documented which color profiles you need and where to get them.

pandoc/MANUAL.txt

Lines 1627 to 1645 in 0ef5665

`pdfa`
: adds to the preamble the setup necessary to generate PDF/A-1b:2005.
To successfully generate PDF/A the required ICC color profiles have to
be available and the content and all included files (such as images)
have to be standard conforming. The ICC profiles can be obtained
from [ConTeXt ICC Profiles]. See also [ConTeXt PDFA] for more
details.
[ConTeXt Paper Setup]: http://wiki.contextgarden.net/PaperSetup
[ConTeXt Layout]: http://wiki.contextgarden.net/Layout
[ConTeXt Font Switching]: http://wiki.contextgarden.net/Font_Switching
[ConTeXt Color]: http://wiki.contextgarden.net/Color
[ConTeXt Headers and Footers]: http://wiki.contextgarden.net/Headers_and_Footers
[ConTeXt Indentation]: http://wiki.contextgarden.net/Indentation
[ConTeXt ICC Profiles]: http://wiki.contextgarden.net/PDFX#ICC_profiles
[ConTeXt PDFA]: http://wiki.contextgarden.net/PDF/A
[`setupwhitespace`]: http://wiki.contextgarden.net/Command/setupwhitespace
[`setupinterlinespace`]: http://wiki.contextgarden.net/Command/setupinterlinespace
[`setuppagenumbering`]: http://wiki.contextgarden.net/Command/setuppagenumbering

@hmenke hmenke deleted the pdfa branch March 18, 2018 21:01
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

Successfully merging this pull request may close these issues.

3 participants