ICCProfileWrapper.java (pdfbox-2.0.23-src) | : | ICCProfileWrapper.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 129 | skipping to change at line 129 | |||
* @param context | * @param context | |||
* @return an instance of ICCProfileWrapper or null if there are no DestOutp utProfile | * @return an instance of ICCProfileWrapper or null if there are no DestOutp utProfile | |||
*/ | */ | |||
private static ICCProfileWrapper searchFirstICCProfile(PreflightContext cont ext) | private static ICCProfileWrapper searchFirstICCProfile(PreflightContext cont ext) | |||
{ | { | |||
PreflightDocument document = context.getDocument(); | PreflightDocument document = context.getDocument(); | |||
PDDocumentCatalog catalog = document.getDocumentCatalog(); | PDDocumentCatalog catalog = document.getDocumentCatalog(); | |||
COSBase cBase = catalog.getCOSObject().getItem(COSName.getPDFName(DOCUME NT_DICTIONARY_KEY_OUTPUT_INTENTS)); | COSBase cBase = catalog.getCOSObject().getItem(COSName.getPDFName(DOCUME NT_DICTIONARY_KEY_OUTPUT_INTENTS)); | |||
COSArray outputIntents = COSUtils.getAsArray(cBase, document.getDocument ()); | COSArray outputIntents = COSUtils.getAsArray(cBase, document.getDocument ()); | |||
for (int i = 0; outputIntents != null && i < outputIntents.size(); ++i) | if (outputIntents == null) | |||
{ | ||||
return null; | ||||
} | ||||
for (int i = 0; i < outputIntents.size(); ++i) | ||||
{ | { | |||
COSDictionary outputIntentDict = COSUtils.getAsDictionary(outputInte nts.get(i), document.getDocument()); | COSDictionary outputIntentDict = COSUtils.getAsDictionary(outputInte nts.get(i), document.getDocument()); | |||
COSBase destOutputProfile = outputIntentDict.getItem(OUTPUT_INTENT_D ICTIONARY_KEY_DEST_OUTPUT_PROFILE); | COSBase destOutputProfile = outputIntentDict.getItem(OUTPUT_INTENT_D ICTIONARY_KEY_DEST_OUTPUT_PROFILE); | |||
if (destOutputProfile != null) | if (destOutputProfile != null) | |||
{ | { | |||
try | try | |||
{ | { | |||
COSStream stream = COSUtils.getAsStream(destOutputProfile, d ocument.getDocument()); | COSStream stream = COSUtils.getAsStream(destOutputProfile, d ocument.getDocument()); | |||
if (stream != null) | if (stream != null) | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added |