title: Can't get PDFBox CreatePDFA example to work - Color profile not found
body: <p>I'm trying to get the example for creating a PDF/A document with Apache PDFBox up an running (<a href="https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePDFA.java?view=markup" rel="nofollow noreferrer">CreatePDFA.java</a>). </p>
  
  <p>For this I copied the example class as is into a project module that includes a maven-dependency on PDFBox in version 2.0.0-RC3. I only changed the method signature and used a fixed font, filename and message instead of args[]. </p>
  
  <p>When trying to run the code I get an NPE in Line 107 because it cant't load the color profile (InputStream is null) When I check the included library in the project details I can see the resources folder, but it does not contain the expected file, namely "pdfa/sRGB Color Space Profile.icm".</p>
  
  <p><a href="https://i.stack.imgur.com/pSEOA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pSEOA.png" alt="Screenshot of PDFBox resources in the project"></a></p>
  
  <p>Unfortunately, google-ing the problem only turned up more references to always the same example implementation, but after a while I acutally found what seems to be the needed file on <a href="https://apache.googlesource.com/pdfbox/+/trunk/examples/src/main/resources/org/apache/pdfbox/resources/pdfa" rel="nofollow noreferrer">apache.googlesource.com</a></p>
  
  <p>I copied the file to our own resource directory and then used this line of code instead:</p>
  
  <pre><code>InputStream colorProfile = CreatePdfA.class.getResourceAsStream("/pdfa/sRGB Color Space Profile.icm");
  </code></pre>
  
  <p>This finally stopped the NPE - the file is apparently found - but now I get another exception which says:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Invalid ICC Profile Data
  </code></pre>
  
  <p>Here, I'm stuck. I had hoped that this would work just out of the box, but it seems like I am missing something. Any ideas?</p>