/** * This method check the Shading entry of the resource dictionary if exists. * * @param context * @param resources * @throws ValidationException */ protected void validateShadingPattern(PreflightContext context, PDResources resources) throws ValidationException { try { for (COSName name : resources.getShadingNames()) { PDShading shading = resources.getShading(name); ContextHelper.validateElement(context, shading, SHADING_PATTERN_PROCESS); } } catch (IOException e) { context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION, e.getMessage(), e)); } }
private Set<String> parseShadingFromResource(PDResources resources) { if (resources == null || resources.getShadingNames() == null) { return null; } Set<String> shadingIDs = new HashSet<>(); for (COSName name : resources.getShadingNames()) { COSDictionary dict = (COSDictionary) resources.getCOSObject().getDictionaryObject(COSName.SHADING); COSBase base = dict.getItem(name); String id = getId(base, FeatureObjectType.SHADING); shadingIDs.add(id); if (checkIDBeforeProcess(id)) { try { PDShading shading = resources.getShading(name); parseShading(shading, id); } catch (IOException e) { LOGGER.info(e); shadingCreationProblem(id, e.getMessage()); } } } return shadingIDs; }
/** * This method check the Shading entry of the resource dictionary if exists. * * @param context * @param resources * @throws ValidationException */ protected void validateShadingPattern(PreflightContext context, PDResources resources) throws ValidationException { try { for (COSName name : resources.getShadingNames()) { PDShading shading = resources.getShading(name); ContextHelper.validateElement(context, shading, SHADING_PATTERN_PROCESS); } } catch (IOException e) { context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION, e.getMessage(), e)); } }
/** * This method check the Shading entry of the resource dictionary if exists. * * @param context * @param resources * @throws ValidationException */ protected void validateShadingPattern(PreflightContext context, PDResources resources) throws ValidationException { try { for (COSName name : resources.getShadingNames()) { PDShading shading = resources.getShading(name); ContextHelper.validateElement(context, shading, SHADING_PATTERN_PROCESS); } } catch (IOException e) { context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_DEFINITION, e.getMessage(), e)); } }