title: Transparency lost when converting PDF to PDF/X1a with Ghostscript
body: <p>We need to convert PDFs created with ApacheFOP and merged with <code>pdftk</code> to PDF/X-1a. I already created a <code>PDFX_def.ps</code> with the following content:</p>
  
  <pre><code>%!
  % This is a sample prefix file for creating a PDF/X-3 document.
  % Feel free to modify entries marked with "Customize".
  % This assumes an ICC profile to reside in the file (ISO Coated sb.icc),
  % unless the user modifies the corresponding line below.
  systemdict /ProcessColorModel known {
  systemdict /ProcessColorModel get dup /DeviceGray ne exch /DeviceCMYK ne and
  } {
  true
  } ifelse
  { (ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.)=
  /ProcessColorModel cvx /rangecheck signalerror
  } if
  % Define entries to the document Info dictionary :
  [ /GTS_PDFXVersion (PDF/X-1:2001) % Must be so (the standard requires).
  /GTS_PDFXConformance (PDF/X-1a:2001)
  /Title (Title) % Customize.
  /Trapped /False % Must be so (Ghostscript doesn't provide other).
  /DOCINFO pdfmark
  % Define an ICC profile :
  /ICCProfile (/var/www/share/data/files/sRGB_IEC61966-2-1_black_scaled.icc) def % Customize or remove.
  currentdict /ICCProfile known {
  [/_objdef {icc_PDFX} /type /stream /OBJ pdfmark
  [{icc_PDFX} &lt;&lt;/N&gt;&gt; /PUT pdfmark
  [{icc_PDFX} ICCProfile (r) file /PUT pdfmark} if
  %Define the output intent dictionary :
  [/_objdef {OutputIntent_PDFX} /type /dict /OBJ pdfmark
  [{OutputIntent_PDFX} &lt;&lt;
  /Type /OutputIntent % Must be so (the standard requires).
  /S /GTS_PDFX % Must be so (the standard requires).
  /OutputCondition (Commercial and specialty printing) % Customize
  /Info (none) % Customize
  /OutputConditionIdentifier (CGATS TR001) % Customize
  /RegistryName (http://www.color.org) % Must be so (the standard requires).
  currentdict /ICCProfile known {
  /DestOutputProfile {icc_PDFX} % Must be so (see above).
  } if
  &gt;&gt; /PUT pdfmark
  [{Catalog} &lt;&lt;/OutputIntents [ {OutputIntent_PDFX} ]&gt;&gt; /PUT pdfmark
  </code></pre>
  
  <p>Then I use this file in the following command:</p>
  
  <pre><code>gs -dPDFX -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor \
     -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite \
     -sOutputFile=output-x1a.pdf PDFX_def.ps output.pdf
  </code></pre>
  
  <p>I'm using Ghostscript 9.05 and here are links to the original and the resulting PDF:</p>
  
  <ul>
  <li><a href="http://content.kartenmacherei.de/original.pdf" rel="nofollow">http://content.kartenmacherei.de/original.pdf</a></li>
  <li><a href="http://content.kartenmacherei.de/pdfx1a_example.pdf" rel="nofollow">http://content.kartenmacherei.de/pdfx1a_example.pdf</a></li>
  </ul>
  
  <p><strong>As you can see on the PDF files the transparency around the image is lost. Do you know how to fix it? Or a better way to create a PDF/X1a file out of the original file with Debian?</strong></p>