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

Produce PDF documentation in PDF/A-1 mode #10

Open
danielfernandez opened this issue Jun 17, 2014 · 1 comment
Open

Produce PDF documentation in PDF/A-1 mode #10

danielfernandez opened this issue Jun 17, 2014 · 1 comment

Comments

@danielfernandez
Copy link
Member

Our current PDF generation process for the thymeleaf-docs repository starts from Markdown documents, and works like this:

  • Convert Markdown to HTML using Pandoc. Pandoc applies an HTML template (which includes our own CSS and JavaScript calls) and transforms the Markdown into HTML.
  • Convert HTML to PDF using wkhtmltopdf. Wkhtmltopdf launches a headless Qt-based WebKit browser and renders the HTML page (including its CSSs --with print media type-- and JavaScript code). The result of rendering is then printed to PDF.

This whole process should be run on the Thymeleaf releases machine, currently CentOS 6.x Linux on Amazon EC2. It should be completely headless and automated with gradle.

The problem is, wkhtmltopdf's output is PDF, but not PDF/A-1 (and it would be nice to have PDF/A-1 docs). Outputting this kind of standard PDF format is not supported by the current version of wkhtmltopdf (0.12.1-61cda93).

A possible solution for converting the current PDF output into PDF/A-1 has already been tried, based on ghostscript (versions 8.70 and 9.14) and a command like:

gs -dPDFA -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -o Using-Thymeleaf_A.pdf Using-Thymeleaf.pdf

...but results aren't correct. With gs 8.70 many links inside the PDF raise an error for lacking a required annotation, and with gs 9.14 these errors are reported as warnings and auto-fixed but some pages are rendered with blue background instead of white. And in both cases the resulting PDFs do not pass a PDF/A-1 validator test.

@danielfernandez
Copy link
Member Author

LibreOffice has also been tested (sending the PDFs to a headless LibreOffice installation in order to ask LibreOffice to convert them to PDF/A-1). Results are really bad, and the output PDF files are not legible anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant