From Wiki
Revision as of 15:51, 14 August 2021 by Roman (talk | contribs)
Jump to navigation Jump to search

Generating a valid PDF/A document with LaTeX is quiet a journey. The success depends on your distribution (TexLive, MikTeX, ...) and your compiler (pdflatex, lualatex, xelatex). Here are some notes to make your live a bit easier.


Before generating a PDF/A, you'll need an ICC-Profile:

Get the file AdobeRGB1998.icc, put it into your folder and rename it to srgb.icc.

Possibility 1: Ghostscript

The easiest way is to compile your LaTeX document normally and than rework it with Ghostscript. Let's say you have a file called thesis.pdf and you want to convert it into a PDF/A conform file thesis-a.pdf with metadata (like author). First create a file called pdfmarks.txt:

[ /Title (document title)
  /Author (author name)
  /Subject (subject description)
  /Keywords (comma, separated, keywords)
  /ModDate (D:20210814112233)
  /CreationDate (D:20210814112233)
  /Creator (application name or creator note)
  /Producer (PDF producer name or note)
  /DOCINFO pdfmark

Now it is time to convert your file, this example is executed in a Windows PowerShell:

    -sColorConversionStrategy=RGB `
    -sProcessColorModel=DeviceRGB `
    -sDEVICE=pdfwrite `
    -dPDFACompatibilityPolicy=1 `
    -sOutputFile="thesis-a.pdf" "PDFA_def.ps" "thesis.pdf" "pdfmarks.txt"

The file PDFA_def.ps is part of Ghostscript. There might be some errors because Ghostscript

Possibility 2: pdfx

Possibility 3: hyperref & hyperxmp