PDFBox - include multiple color profiles during conversion to PDF/A
<p>We are currently trying to merge multiple PDFs and create a PDF/A (1B) out of it.</p>

<p>Currently we face a problem when we want to fix the color profiles. The PDF we receive has no embedded color profiles, so during the merge functionality of PDFBox, no OutputIntents are merged. So in the last step we try to add the color profiles.</p>

<p>If we do not add any color profile, we get validation issues for RGB and CMYK. If we add both color profiles to the PDDocumentCatalog, then only the validation issues for the first one are gone. So if we add RGB first, we only get CMYK validation issues and vice versa.</p>

<p>Here is a part of the code when we add the color profiles:</p>

<pre><code>      public void convertToPDFA(PDDocument doc, String file){

              PDMetadata metadata = new PDMetadata(doc);
              PDDocumentCatalog cat = doc.getDocumentCatalog();
              cat.setMetadata(metadata);

              // do metadata stuff, just removed it for now

              InputStream colorProfile = PDFService.class.getResourceAsStream("/pdfa/sRGB Color Space Profile.icm");
              PDOutputIntent oi = new PDOutputIntent(doc, colorProfile);
              oi.setInfo("sRGB IEC61966-2.1");
              oi.setOutputCondition("sRGB IEC61966-2.1");
              oi.setOutputConditionIdentifier("sRGB IEC61966-2.1");
              oi.setRegistryName("http://www.color.org");
              cat.addOutputIntent(oi); 
</code></pre>

<p>This is the code for RGB, we also add another *.icm color profile for CMYK.
So the color profiles seem to be fine, because dependent on the one we add first, the validation issues are gone.</p>

<p>For me it feels like we are just missing a small thing that both color profiles will be accepted, or could it be that only one color profile can be used for the creation of a PDF/A?</p>

<p>Thanks in advance and kind regards</p>