title: GhostScript PDF 1.5 (from tiff to PDF with ImageMagick) convert to PDF/A
body: <p>I need to create a PDF/A from a Folder of Tiff Files.
  Creating a PDF (1.5) is working with ImageMagick.
  But Converting this PDF to a PDF/A using Ghostscript is a problem.</p>
  
  <p>My GhostScript cmd:</p>
  
  <pre><code>-dPDFA=2 -dNOOUTERSAVE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -o "C:\Temp\TestData\TIFF to PDF Imagemagick\pdfa.pdf" "C:\Temp\TestData\TIFF to PDF Imagemagick\PDFA_def.ps" -dPDFACompatibilityPolicy=1 "C:\Temp\TestData\TIFF to PDF Imagemagick\test.pdf"
  </code></pre>
  
  <p>Also tryed:</p>
  
  <pre><code>-dPDFA=2 -dBATCH -dNOPAUSE -sColorConversionStrategy=RGB -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile="C:\Temp\TestData\TIFF to PDF Imagemagick\pdfa.pdf" "C:\Temp\TestData\TIFF to PDF Imagemagick\PDFA_def.ps" "C:\Temp\TestData\TIFF to PDF Imagemagick\test.pdf"
  </code></pre>
  
  <p>my PDFA_def.ps is the GS standard with:</p>
  
  <pre><code>/ICCProfile (AdobeRGB1998.icc) % Customise
  </code></pre>
  
  <p>The created PDF/? is not passing the "Verify compliance with PDF/A-2b" preflight in Adobe Acrobat:</p>
  
  <pre><code>Error
  Metadata missing (XMP)
  PDF/A entry missing
  Syntax problem: Indirect object “endobj” keyword not preceded by an EOL marker
  Syntax problem: Stream dictionary improperly formatted
  </code></pre>
  
  <p>Also not the <a href="https://www.pdf-online.com/osa/validate.aspx" rel="nofollow noreferrer">https://www.pdf-online.com/osa/validate.aspx</a> validator:</p>
  
  <pre><code>File    pdfa.pdf
  Compliance  pdf1.5
  Result  Document does not conform to PDF/A.
  Details 
  Validating file "pdfa.pdf" for conformance level pdf1.5
  XML line 10:212: xmlParseCharRef: invalid xmlChar value 0.
  The document does not conform to the requested standard.
  The document's meta data is either missing or inconsistent or corrupt.
  The document does not conform to the PDF 1.5 standard.
  Done.
  </code></pre>
  
  <p>Also tryed VeraPDF ....</p>
  
  <p>What kind of settings have I forgotten?</p>