title: PDF to PDF/A-2b without dUseCIEColor
body: <p>My goal is to take arbitrary PDF from the users, and save it as PDF/A-2b.</p>
  
  <p>The current approach is to use Ghostscript 9.21 (via ghost4j) to create the converted file. This works but not without some problems. I got it to work with two different sets of parameters to Ghostscript.</p>
  
  <p><strong>Firstly</strong></p>
  
  <p>Using the option <code>-dUseCIEColor</code> as shown below will work, and produces valid PDF/A-2b with a couple of different test files. This will however print pages of errors into the log saying it is not recommended to use.</p>
  
  <p>These are the full arguments:</p>
  
  <pre><code>-dBATCH
  -dNOPAUSE
  -dPrinted=true
  -sDEVICE=pdfwrite
  -dPDFACompatibilityPolicy=1
  -sColorConversionStrategy=/UseDeviceIndependentColor
  -sProcessColorModel=DeviceCMYK
  -sOutputICCProfile=/tmp/icc.icc
  -sOutputFile=/tmp/result.pdf
  -dPDFA=2
  -dUseCIEColor
  /tmp/PDFA_def.ps
  /tmp/test.pdf
  </code></pre>
  
  <p>And the PDFA_def.ps is the default supplier 9.21, pointing to the same ICC Profile and this line in the bottom:</p>
  
  <pre><code>&lt;&lt;/NeverEmbed []&gt;&gt; setdistillerparams
  </code></pre>
  
  <p>The ICC Profile is a random (CMYK) profile published by Adobe.</p>
  
  <p>This works, apart from the errors in the log.</p>
  
  <p><strong>Secondly</strong></p>
  
  <p>Then I will try to do as the log errors told, and remove the <code>-dUseCIEColor</code>.</p>
  
  <p>Now some of the test files work, some wont. I suspect this has to do with the color profile of the original PDF, or something like that.</p>
  
  <p>3-heights gives the validation error: <em>A device-specific color space (DeviceRGB) without an appropriate output intent is used.</em></p>
  
  <p>This can be corrected by switching the <code>-sProcessColorModel=DeviceRGB</code> and switch the ICC Profile to an random RGB profile.</p>
  
  <p>Then for another document, you get the error: <em>A device-specific color space (DeviceCMYK) without an appropriate output intent is used.</em></p>
  
  <p>Is there something I'm missing with this? It would seem I need to switch the options based on the original PDF file which would be far from the preferred style. If it helps, I would be fine with black and white PDF/A-2b too. Thanks!</p>