Class PdfA2Checker
java.lang.Object
com.itextpdf.pdfa.checker.PdfAChecker
com.itextpdf.pdfa.checker.PdfA1Checker
com.itextpdf.pdfa.checker.PdfA2Checker
- All Implemented Interfaces:
IValidationChecker
- Direct Known Subclasses:
PdfA3Checker
PdfA2Checker defines the requirements of the PDF/A-2 standard and contains a
number of methods that override the implementations of its superclass
PdfA1Checker.
The specification implemented by this class is ISO 19005-2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate static final org.slf4j.Loggerprivate static final int(package private) static final int(package private) static final intprivate static final StringFields inherited from class PdfA1Checker
allowedNamedActions, allowedRenderingIntents, contentAnnotationsFields inherited from class PdfAChecker
checkedObjects, checkedObjectsColorspace, cmykUsedObjects, conformance, EXCEPTION_SUPPLIER, grayUsedObjects, gsStackDepth, ICC_COLOR_SPACE_CMYK, ICC_COLOR_SPACE_GRAY, ICC_COLOR_SPACE_RGB, ICC_DEVICE_CLASS_MONITOR_PROFILE, ICC_DEVICE_CLASS_OUTPUT_PROFILE, maxGsStackDepth, pdfAOutputIntentColorSpace, pdfAOutputIntentDestProfile, rgbUsedObjects -
Constructor Summary
ConstructorsConstructorDescriptionPdfA2Checker(PdfAConformance aConformance) Creates a PdfA2Checker with the required conformance -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAnnotation(PdfDictionary annotDic) Verify the conformity of the annotation dictionary.protected voidcheckAnnotationAgainstActions(PdfDictionary annotDic) Checked annotation against actions, exception will be thrown if eitherAorAAactions aren't allowed for specific type of annotation.(package private) voidcheckAnnotationsForTransparency(PdfArray annotations) protected voidcheckAppearanceStream(PdfStream appearanceStream) Check single annotation appearance stream.private voidcheckAppearanceStreamForTransparency(PdfDictionary ap, Set<PdfObject> checkedObjects) protected voidcheckBlendMode(PdfName blendMode) Check if blendMode is compatible with pdf/a standard being used.protected voidChecks if the catalog is compliant with the PDF/A-2 standard.private voidcheckCatalogConfig(PdfDictionary config, HashSet<PdfObject> ocgs, HashSet<String> names) protected voidcheckCatalogValidEntries(PdfDictionary catalogDict) Checks if entries in catalog dictionary are valid.voidcheckColor(CanvasGraphicsState gState, Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream contentStream) This method checks compliance with the color restrictions imposed by the available color spaces in the document.voidcheckColorSpace(PdfColorSpace colorSpace, PdfObject pdfObject, PdfDictionary currentColorSpaces, boolean checkAlternate, Boolean fill) This method performs a range of checks on the given color space, depending on the type and properties of that color space.protected voidCheck optional content configuration dictionary against AS key.(package private) voidcheckContentsForTransparency(PdfDictionary pageDict) private booleancheckDefaultCS(PdfObject pdfObject, PdfDictionary currentColorSpaces, Boolean fill, PdfName defaultCsName, int numOfComponents) voidcheckExtGState(CanvasGraphicsState extGState, PdfStream contentStream) Performs a number of checks on the graphics state, among others ISO 19005-1 section 6.2.8 and 6.4 and ISO 19005-2 section 6.2.5 and 6.2.10.protected voidcheckFileSpec(PdfDictionary fileSpec) Verify the conformity of the file specification dictionary.voidcheckFontGlyphs(PdfFont font, PdfStream contentStream) Performs a check of the each font glyph as a Form XObject.protected voidcheckForm(PdfDictionary form) Verify the conformity of the form dictionary.protected voidcheckFormXObject(PdfStream form) For pdf/a-2+ checkers this method is overridden to usecheckFormXObject(PdfStream form, PdfStream contentStream)method.protected voidcheckFormXObject(PdfStream form, PdfStream contentStream) Verify the conformity of the Form XObject with appropriate specification.protected voidcheckImage(PdfStream image, PdfDictionary currentColorSpaces) Verify the conformity of the given image.voidcheckInlineImage(PdfStream inlineImage, PdfDictionary currentColorSpaces) This method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.protected voidcheckNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) Verify the conformity of the non-symbolic TrueType font.protected voidChecks the number of components in DeviceN color space.private voidcheckObjectWithResourcesForTransparency(PdfObject objectWithResources, Set<PdfObject> checkedObjects) private voidcheckOCProperties(PdfDictionary oCProperties) protected voidcheckOutputIntents(PdfDictionary catalog) Verify the conformity of the output intents array in the catalog dictionary.protected voidChecks if the page is compliant with the PDF/A-2 standard.protected voidcheckPageColorsUsages(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of used color spaces on the page.protected voidcheckPageObject(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of the page dictionary.protected voidcheckPageSize(PdfDictionary page) Checks the allowable size of the page.protected voidcheckPageTransparency(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of the page transparency.protected voidcheckPdfArray(PdfArray array) Verify the conformity of the PDF array.protected voidcheckPdfDictionary(PdfDictionary dictionary) Verify the conformity of the PDF dictionary.protected voidcheckPdfStream(PdfStream stream) Verify the conformity of the PDF stream.(package private) voidcheckResourcesForTransparency(PdfDictionary resources, Set<PdfObject> checkedObjects) private voidcheckSeparationCS(PdfArray separation) private voidcheckSeparationInsideDeviceN(PdfArray separation, PdfObject deviceNColorSpace, PdfObject deviceNTintTransform) voidcheckSignature(PdfDictionary signatureDict) This method checks compliance of the signature dictionaryprivate voidcheckSingleResourceTypeForTransparency(PdfDictionary singleResourceDict, Set<PdfObject> checkedObjects) protected voidcheckTransparencyGroup(PdfStream form, PdfStream contentStream) Verify the conformity of the transparency group XObject with appropriate specification.private voidcheckType3FontGlyphs(PdfType3Font font, PdfStream contentStream) private voidfillOrderRecursively(PdfArray orderArray, Set<PdfObject> order) Retrieve allowed actions in conforming document.Gets annotation types which are allowed not to have appearance stream.Retrieve forbidden actions in conforming document.Gets forbidden annotation types.protected doubleRetrieve maximum allowed real value.protected intReturns maximum allowed bytes length of the string in a PDF document.protected StringRetrieve transparency error message valid for the pdf/a standard being used.private booleanisAltCSIsTheSame(PdfObject cs1, PdfObject cs2) private static booleanisAnnotationInvisible(int flags) Methods inherited from class PdfA1Checker
checkAction, checkCanvasStack, checkCatalog, checkContentStream, checkCrypto, checkFont, checkLogicalStructure, checkMetaData, checkPdfName, checkPdfNumber, checkPdfString, checkRenderingIntent, checkSignatureType, checkSymbolicTrueTypeFont, checkText, checkTrailer, checkXrefTable, getFormFields, getMaxIntegerValue, getMaxNameLength, getMaxNumberOfIndirectObjects, getMinIntegerValueMethods inherited from class PdfAChecker
checkContentStreamObject, checkDocument, checkFlag, checkPdfObject, checkResources, checkResourcesOfAppearanceStreams, checkSinglePage, checkStructure, checkTagStructureElement, getAConformance, getPdfAOutputIntent, isAlreadyChecked, isContainsTransparencyGroup, isFullCheckMode, isPdfObjectReadyToFlush, setFullCheckMode, setPdfAOutputIntentColorSpace, validate
-
Field Details
-
forbiddenAnnotations
-
apLessAnnotations
-
forbiddenActions
-
allowedBlendModes
-
allowedFilters
-
allowedInlineImageFilters
-
transparencyObjects
-
MAX_PAGE_SIZE
static final int MAX_PAGE_SIZE- See Also:
-
MIN_PAGE_SIZE
static final int MIN_PAGE_SIZE- See Also:
-
MAX_NUMBER_OF_DEVICEN_COLOR_COMPONENTS
private static final int MAX_NUMBER_OF_DEVICEN_COLOR_COMPONENTS- See Also:
-
logger
private static final org.slf4j.Logger logger -
TRANSPARENCY_ERROR_MESSAGE
- See Also:
-
currentFillCsIsIccBasedCMYK
private boolean currentFillCsIsIccBasedCMYK -
currentStrokeCsIsIccBasedCMYK
private boolean currentStrokeCsIsIccBasedCMYK -
separationColorSpaces
-
-
Constructor Details
-
PdfA2Checker
Creates a PdfA2Checker with the required conformance- Parameters:
aConformance- the required conformance,aoruorb
-
-
Method Details
-
checkInlineImage
Description copied from class:PdfACheckerThis method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.- Overrides:
checkInlineImagein classPdfA1Checker- Parameters:
inlineImage- aPdfStreamcontaining the inline imagecurrentColorSpaces- aPdfDictionarycontaining the color spaces used in the document
-
checkColor
public void checkColor(CanvasGraphicsState gState, Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream contentStream) This method checks compliance with the color restrictions imposed by the available color spaces in the document.- Overrides:
checkColorin classPdfA1Checker- Parameters:
gState- canvas graphics statecolor- the color to checkcurrentColorSpaces- aPdfDictionarycontaining the color spaces used in the documentfill- whether the color is used for fill or stroke operationscontentStream- current content stream
-
checkColorSpace
public void checkColorSpace(PdfColorSpace colorSpace, PdfObject pdfObject, PdfDictionary currentColorSpaces, boolean checkAlternate, Boolean fill) This method performs a range of checks on the given color space, depending on the type and properties of that color space.- Overrides:
checkColorSpacein classPdfA1Checker- Parameters:
colorSpace- the color space to checkpdfObject- the pdf object to check color space incurrentColorSpaces- aPdfDictionarycontaining the color spaces used in the documentcheckAlternate- whether or not to also check the parent color spacefill- whether the color space is used for fill or stroke operations
-
checkExtGState
Description copied from class:PdfACheckerPerforms a number of checks on the graphics state, among others ISO 19005-1 section 6.2.8 and 6.4 and ISO 19005-2 section 6.2.5 and 6.2.10. This method will be abstract in the update 7.2- Overrides:
checkExtGStatein classPdfA1Checker- Parameters:
extGState- the graphics state to be checkedcontentStream- current content stream
-
checkSignature
Description copied from class:PdfACheckerThis method checks compliance of the signature dictionary- Overrides:
checkSignaturein classPdfAChecker- Parameters:
signatureDict- aPdfDictionarycontaining the signature.
-
checkNumberOfDeviceNComponents
Checks the number of components in DeviceN color space.- Parameters:
deviceN- the color space to check
-
checkNonSymbolicTrueTypeFont
Description copied from class:PdfACheckerVerify the conformity of the non-symbolic TrueType font.- Overrides:
checkNonSymbolicTrueTypeFontin classPdfA1Checker- Parameters:
trueTypeFont- thePdfTrueTypeFontto check
-
getMaxRealValue
protected double getMaxRealValue()Description copied from class:PdfA1CheckerRetrieve maximum allowed real value.- Overrides:
getMaxRealValuein classPdfA1Checker- Returns:
- maximum allowed real number
-
getMaxStringLength
protected int getMaxStringLength()Description copied from class:PdfA1CheckerReturns maximum allowed bytes length of the string in a PDF document.- Overrides:
getMaxStringLengthin classPdfA1Checker- Returns:
- maximum string length
-
checkPdfArray
Description copied from class:PdfACheckerVerify the conformity of the PDF array.- Overrides:
checkPdfArrayin classPdfA1Checker- Parameters:
array- thePdfArrayto check
-
checkPdfDictionary
Description copied from class:PdfACheckerVerify the conformity of the PDF dictionary.- Overrides:
checkPdfDictionaryin classPdfA1Checker- Parameters:
dictionary- thePdfDictionaryto check
-
checkAnnotation
Verify the conformity of the annotation dictionary.- Overrides:
checkAnnotationin classPdfA1Checker- Parameters:
annotDic- the annotationPdfDictionaryto be checked
-
getAppearanceLessAnnotations
-
checkAnnotationAgainstActions
Checked annotation against actions, exception will be thrown if eitherAorAAactions aren't allowed for specific type of annotation.- Parameters:
annotDic- an annotation PDF dictionary
-
getForbiddenAnnotations
Gets forbidden annotation types.- Overrides:
getForbiddenAnnotationsin classPdfA1Checker- Returns:
- a set of forbidden annotation types
-
checkAppearanceStream
Description copied from class:PdfACheckerCheck single annotation appearance stream.- Overrides:
checkAppearanceStreamin classPdfAChecker- Parameters:
appearanceStream- thePdfStreamto check
-
checkForm
Description copied from class:PdfACheckerVerify the conformity of the form dictionary.- Overrides:
checkFormin classPdfA1Checker- Parameters:
form- the formPdfDictionaryto be checked
-
checkCatalogAAConformance
Checks if the catalog is compliant with the PDF/A-2 standard.- Parameters:
dict- the catalog dictionary
-
checkCatalogValidEntries
Description copied from class:PdfACheckerChecks if entries in catalog dictionary are valid.- Overrides:
checkCatalogValidEntriesin classPdfA1Checker- Parameters:
catalogDict- the catalogPdfDictionaryto be checked
-
checkPageSize
Description copied from class:PdfACheckerChecks the allowable size of the page.- Overrides:
checkPageSizein classPdfA1Checker- Parameters:
page- thePdfDictionaryof page which size being checked
-
checkFileSpec
Description copied from class:PdfACheckerVerify the conformity of the file specification dictionary.- Overrides:
checkFileSpecin classPdfA1Checker- Parameters:
fileSpec- thePdfDictionarycontaining file specification to be checked
-
checkPdfStream
Description copied from class:PdfACheckerVerify the conformity of the PDF stream.- Overrides:
checkPdfStreamin classPdfA1Checker- Parameters:
stream- thePdfStreamto check
-
checkPageAAConformance
Checks if the page is compliant with the PDF/A-2 standard.- Parameters:
dict- the page dictionary
-
checkPageObject
Description copied from class:PdfACheckerVerify the conformity of the page dictionary.- Overrides:
checkPageObjectin classPdfA1Checker- Parameters:
pageDict- thePdfDictionaryto checkpageResources- the page's resources dictionary
-
checkPageTransparency
Description copied from class:PdfACheckerVerify the conformity of the page transparency.- Overrides:
checkPageTransparencyin classPdfA1Checker- Parameters:
pageDict- thePdfDictionarycontains contents for transparency to be checkedpageResources- thePdfDictionarycontains resources for transparency to be checked
-
checkOutputIntents
Description copied from class:PdfACheckerVerify the conformity of the output intents array in the catalog dictionary.- Overrides:
checkOutputIntentsin classPdfA1Checker- Parameters:
catalog- thePdfDictionaryof a catalog or page to check
-
getForbiddenActions
Description copied from class:PdfACheckerRetrieve forbidden actions in conforming document.- Overrides:
getForbiddenActionsin classPdfA1Checker- Returns:
- set of
PdfNamewith forbidden actions
-
getAllowedNamedActions
Description copied from class:PdfACheckerRetrieve allowed actions in conforming document.- Overrides:
getAllowedNamedActionsin classPdfA1Checker- Returns:
- set of
PdfNamewith allowed named actions
-
checkPageColorsUsages
Verify the conformity of used color spaces on the page.- Overrides:
checkPageColorsUsagesin classPdfA1Checker- Parameters:
pageDict- thePdfDictionarycontains contents for colors to be checkedpageResources- thePdfDictionarycontains resources for colors to be checked
-
checkOCProperties
-
checkImage
Description copied from class:PdfACheckerVerify the conformity of the given image.- Overrides:
checkImagein classPdfA1Checker- Parameters:
image- the image to checkcurrentColorSpaces- thePdfDictionarycontaining the color spaces used in the document
-
checkFontGlyphs
Description copied from class:PdfACheckerPerforms a check of the each font glyph as a Form XObject. See ISO 19005-2 Annex A.5. This only applies to type 3 fonts. This method will be abstract in update 7.2- Overrides:
checkFontGlyphsin classPdfA1Checker- Parameters:
font-PdfFontto be checkedcontentStream- stream containing checked font
-
checkFormXObject
For pdf/a-2+ checkers this method is overridden to usecheckFormXObject(PdfStream form, PdfStream contentStream)method.- Overrides:
checkFormXObjectin classPdfA1Checker- Parameters:
form- thePdfStreamto check
-
checkFormXObject
Verify the conformity of the Form XObject with appropriate specification. Throws PdfAConformanceException if any discrepancy was found -
checkTransparencyGroup
Verify the conformity of the transparency group XObject with appropriate specification. Throws PdfAConformanceException if any discrepancy was found -
checkContentConfigurationDictAgainstAsKey
Check optional content configuration dictionary against AS key.- Parameters:
config- a content configuration dictionary
-
getTransparencyErrorMessage
Retrieve transparency error message valid for the pdf/a standard being used.- Returns:
- error message.
-
checkBlendMode
Check if blendMode is compatible with pdf/a standard being used.- Parameters:
blendMode- blend mode name to check.
-
checkContentsForTransparency
-
checkAnnotationsForTransparency
-
checkResourcesForTransparency
-
isAnnotationInvisible
private static boolean isAnnotationInvisible(int flags) -
checkAppearanceStreamForTransparency
-
checkObjectWithResourcesForTransparency
-
checkSingleResourceTypeForTransparency
private void checkSingleResourceTypeForTransparency(PdfDictionary singleResourceDict, Set<PdfObject> checkedObjects) -
checkSeparationInsideDeviceN
-
checkSeparationCS
-
isAltCSIsTheSame
-
checkCatalogConfig
private void checkCatalogConfig(PdfDictionary config, HashSet<PdfObject> ocgs, HashSet<String> names) -
fillOrderRecursively
-
checkDefaultCS
private boolean checkDefaultCS(PdfObject pdfObject, PdfDictionary currentColorSpaces, Boolean fill, PdfName defaultCsName, int numOfComponents) -
checkType3FontGlyphs
-