Package com.itextpdf.pdfa.checker
Class PdfA1Checker
java.lang.Object
com.itextpdf.pdfa.checker.PdfAChecker
com.itextpdf.pdfa.checker.PdfA1Checker
- All Implemented Interfaces:
-
IValidationChecker
- Direct Known Subclasses:
-
PdfA2Checker
PdfA1Checker defines the requirements of the PDF/A-1 standard and contains method implementations from the abstract
PdfAChecker class.
The specification implemented by this class is ISO 19005-1
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.itextpdf.pdfa.checker.PdfAChecker
checkedObjects, checkedObjectsColorspace, cmykUsedObjects, conformance, 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
ConstructorsConstructorDescriptionPdfA1Checker(PdfAConformance aConformance) Creates a PdfA1Checker with the required conformance -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAction(PdfDictionary action) Checks if the action is allowed.protected voidcheckAnnotation(PdfDictionary annotDic) Verify the conformity of the annotation dictionary.voidcheckCanvasStack(char stackOperation) This method checks compliance with the graphics state architectural limitation, explained byPdfAChecker.maxGsStackDepth.protected voidcheckCatalog(PdfCatalog catalog) Verify the conformity of the pdf catalog.protected voidcheckCatalogValidEntries(PdfDictionary catalogDict) Checks if entries in catalog dictionary are valid.voidcheckColor(CanvasGraphicsState graphicsState, Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream stream) 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 voidcheckContentStream(PdfStream contentStream) Attest content stream conformance with appropriate specification.voidcheckCrypto(PdfObject crypto) Verify the conformity of encryption usage.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.voidPerforms a number of checks on the font.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) Verify the conformity of the form XObject dictionary.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 voidcheckLogicalStructure(PdfDictionary catalog) Performs a number of checks on the logical structure of the document.protected voidcheckMetaData(PdfDictionary catalog) Performs a number of checks on the metadata of the document.protected voidcheckNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) Verify the conformity of the non-symbolic TrueType font.protected voidcheckOutputIntents(PdfDictionary catalog) Verify the conformity of the output intents array in the catalog dictionary.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 voidcheckPdfName(PdfName name) Verify the conformity of the PDF name.protected voidcheckPdfNumber(PdfNumber number) Verify the conformity of the PDF number.protected voidcheckPdfStream(PdfStream stream) Verify the conformity of the PDF stream.protected voidcheckPdfString(PdfString string) Verify the conformity of the PDF string.voidcheckRenderingIntent(PdfName intent) Checks whether the rendering intent of the document is within the allowed range of intents.voidcheckSignatureType(boolean isCAdES) This method checks compliance of the signature type.protected voidcheckSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) Verify the conformity of the symbolic TrueType font.voidVerify the conformity of the text written by the specified font.protected voidcheckTrailer(PdfDictionary trailer) Verify the conformity of the trailer dictionary.voidcheckXrefTable(PdfXrefTable xrefTable) Verify the conformity of the cross-reference table.Retrieve allowed actions in conforming document.Retrieve forbidden actions in conforming document.Gets forbidden annotation types.protected PdfArraygetFormFields(PdfArray array) Deprecated.protected longRetrieve maximal allowed integer value.protected intRetrieve maximum allowed length of the name object.protected longRetrieve maximum allowed number of indirect objects in conforming document.protected doubleRetrieve maximum allowed real value.protected intReturns maximum allowed bytes length of the string in a PDF document.protected longRetrieve minimal allowed integer value.Methods inherited from class com.itextpdf.pdfa.checker.PdfAChecker
checkAppearanceStream, checkContentStreamObject, checkDocument, checkFlag, checkPdfObject, checkResources, checkResourcesOfAppearanceStreams, checkSignature, checkSinglePage, checkStructure, checkTagStructureElement, getAConformance, isAlreadyChecked, isContainsTransparencyGroup, isFullCheckMode, isPdfObjectReadyToFlush, setFullCheckMode, setPdfAOutputIntentColorSpace, validate
-
Field Details
-
forbiddenAnnotations
-
contentAnnotations
-
forbiddenActions
-
allowedNamedActions
-
allowedRenderingIntents
-
-
Constructor Details
-
PdfA1Checker
Creates a PdfA1Checker with the required conformance- Parameters:
-
aConformance- the required conformance,aorb
-
-
Method Details
-
checkCanvasStack
public void checkCanvasStack(char stackOperation) Description copied from class:PdfACheckerThis method checks compliance with the graphics state architectural limitation, explained byPdfAChecker.maxGsStackDepth.- Specified by:
-
checkCanvasStackin classPdfAChecker - Parameters:
-
stackOperation- the operation to check the graphics state counter for
-
checkInlineImage
Description copied from class:PdfACheckerThis method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.- Specified by:
-
checkInlineImagein classPdfAChecker - Parameters:
-
inlineImage- aPdfStreamcontaining the inline image -
currentColorSpaces- aPdfDictionarycontaining the color spaces used in the document
-
checkColor
public void checkColor(CanvasGraphicsState graphicsState, Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream stream) This method checks compliance with the color restrictions imposed by the available color spaces in the document.- Specified by:
-
checkColorin classPdfAChecker - Parameters:
-
graphicsState- canvas graphics state -
color- the color to check -
currentColorSpaces- aPdfDictionarycontaining the color spaces used in the document -
fill- whether the color is used for fill or stroke operations -
stream- 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.- Specified by:
-
checkColorSpacein classPdfAChecker - Parameters:
-
colorSpace- the color space to check -
pdfObject- the pdf object to check color space in -
currentColorSpaces- aPdfDictionarycontaining the color spaces used in the document -
checkAlternate- whether or not to also check the parent color space -
fill- whether the color space is used for fill or stroke operations
-
checkXrefTable
Description copied from class:PdfACheckerVerify the conformity of the cross-reference table.- Specified by:
-
checkXrefTablein classPdfAChecker - Parameters:
-
xrefTable- is the Xref table
-
getForbiddenActions
Description copied from class:PdfACheckerRetrieve forbidden actions in conforming document.- Specified by:
-
getForbiddenActionsin classPdfAChecker - Returns:
-
set of
PdfNamewith forbidden actions
-
getAllowedNamedActions
Description copied from class:PdfACheckerRetrieve allowed actions in conforming document.- Specified by:
-
getAllowedNamedActionsin classPdfAChecker - Returns:
-
set of
PdfNamewith allowed named actions
-
getMaxNumberOfIndirectObjects
protected long getMaxNumberOfIndirectObjects()Description copied from class:PdfACheckerRetrieve maximum allowed number of indirect objects in conforming document.- Specified by:
-
getMaxNumberOfIndirectObjectsin classPdfAChecker - Returns:
- maximum allowed number of indirect objects
-
checkPageColorsUsages
Verify the conformity of used color spaces on the page.- Specified by:
-
checkPageColorsUsagesin classPdfAChecker - Parameters:
-
pageDict- thePdfDictionarycontains contents for colors to be checked -
pageResources- thePdfDictionarycontains resources for colors to be checked
-
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- Specified by:
-
checkExtGStatein classPdfAChecker - Parameters:
-
extGState- the graphics state to be checked -
contentStream- current content stream
-
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- Specified by:
-
checkFontGlyphsin classPdfAChecker - Parameters:
-
font-PdfFontto be checked -
contentStream- stream containing checked font
-
checkRenderingIntent
Description copied from class:PdfACheckerChecks whether the rendering intent of the document is within the allowed range of intents. This is defined in ISO 19005-1 section 6.2.9, and unchanged in newer generations of the PDF/A specification.- Specified by:
-
checkRenderingIntentin classPdfAChecker - Parameters:
-
intent- the intent to be analyzed
-
checkFont
Description copied from class:PdfACheckerPerforms a number of checks on the font. See ISO 19005-1 section 6.3, ISO 19005-2 and ISO 19005-3 section 6.2.11. Be aware that not all constraints defined in the ISO are checked in this method, for most of them we consider that iText always creates valid fonts.- Specified by:
-
checkFontin classPdfAChecker - Parameters:
-
pdfFont- font to be checked
-
checkCrypto
Verify the conformity of encryption usage.- Specified by:
-
checkCryptoin classPdfAChecker - Parameters:
-
crypto- encryption object to verify
-
checkSignatureType
public void checkSignatureType(boolean isCAdES) This method checks compliance of the signature type.- Specified by:
-
checkSignatureTypein classPdfAChecker - Parameters:
-
isCAdES-trueif CAdES signature type is used,falseotherwise
-
checkText
Verify the conformity of the text written by the specified font.- Specified by:
-
checkTextin classPdfAChecker - Parameters:
-
text- text to verify -
font- font to verify the text against
-
checkPageTransparency
Description copied from class:PdfACheckerVerify the conformity of the page transparency.- Specified by:
-
checkPageTransparencyin classPdfAChecker - Parameters:
-
pageDict- thePdfDictionarycontains contents for transparency to be checked -
pageResources- thePdfDictionarycontains resources for transparency to be checked
-
checkContentStream
Description copied from class:PdfACheckerAttest content stream conformance with appropriate specification. Throws PdfAConformanceException if any discrepancy was found- Specified by:
-
checkContentStreamin classPdfAChecker - Parameters:
-
contentStream- is a content stream to validate
-
checkNonSymbolicTrueTypeFont
Description copied from class:PdfACheckerVerify the conformity of the non-symbolic TrueType font.- Specified by:
-
checkNonSymbolicTrueTypeFontin classPdfAChecker - Parameters:
-
trueTypeFont- thePdfTrueTypeFontto check
-
checkSymbolicTrueTypeFont
Description copied from class:PdfACheckerVerify the conformity of the symbolic TrueType font.- Specified by:
-
checkSymbolicTrueTypeFontin classPdfAChecker - Parameters:
-
trueTypeFont- thePdfTrueTypeFontto check
-
checkImage
Description copied from class:PdfACheckerVerify the conformity of the given image.- Specified by:
-
checkImagein classPdfAChecker - Parameters:
-
image- the image to check -
currentColorSpaces- thePdfDictionarycontaining the color spaces used in the document
-
checkFormXObject
Description copied from class:PdfACheckerVerify the conformity of the form XObject dictionary.- Specified by:
-
checkFormXObjectin classPdfAChecker - Parameters:
-
form- thePdfStreamto check
-
checkLogicalStructure
Description copied from class:PdfACheckerPerforms a number of checks on the logical structure of the document.- Specified by:
-
checkLogicalStructurein classPdfAChecker - Parameters:
-
catalog- the catalogPdfDictionaryto check
-
checkMetaData
Description copied from class:PdfACheckerPerforms a number of checks on the metadata of the document.- Specified by:
-
checkMetaDatain classPdfAChecker - Parameters:
-
catalog- the catalogPdfDictionaryto check
-
checkOutputIntents
Description copied from class:PdfACheckerVerify the conformity of the output intents array in the catalog dictionary.- Specified by:
-
checkOutputIntentsin classPdfAChecker - Parameters:
-
catalog- thePdfDictionaryof a catalog or page to check
-
checkPdfNumber
Description copied from class:PdfACheckerVerify the conformity of the PDF number.- Specified by:
-
checkPdfNumberin classPdfAChecker - Parameters:
-
number- thePdfNumberto check
-
getMaxRealValue
protected double getMaxRealValue()Retrieve maximum allowed real value.- Returns:
- maximum allowed real number
-
getMaxIntegerValue
protected long getMaxIntegerValue()Retrieve maximal allowed integer value.- Returns:
- maximal allowed integer number
-
getMinIntegerValue
protected long getMinIntegerValue()Retrieve minimal allowed integer value.- Returns:
- minimal allowed integer number
-
checkPdfArray
Description copied from class:PdfACheckerVerify the conformity of the PDF array.- Specified by:
-
checkPdfArrayin classPdfAChecker - Parameters:
-
array- thePdfArrayto check
-
checkPdfDictionary
Description copied from class:PdfACheckerVerify the conformity of the PDF dictionary.- Specified by:
-
checkPdfDictionaryin classPdfAChecker - Parameters:
-
dictionary- thePdfDictionaryto check
-
checkPdfStream
Description copied from class:PdfACheckerVerify the conformity of the PDF stream.- Specified by:
-
checkPdfStreamin classPdfAChecker - Parameters:
-
stream- thePdfStreamto check
-
checkPdfName
Description copied from class:PdfACheckerVerify the conformity of the PDF name.- Specified by:
-
checkPdfNamein classPdfAChecker - Parameters:
-
name- thePdfNameto check
-
getMaxNameLength
protected int getMaxNameLength()Retrieve maximum allowed length of the name object.- Returns:
- maximum allowed length of the name
-
checkPdfString
Description copied from class:PdfACheckerVerify the conformity of the PDF string.- Specified by:
-
checkPdfStringin classPdfAChecker - Parameters:
-
string- thePdfStringto check
-
getMaxStringLength
protected int getMaxStringLength()Returns maximum allowed bytes length of the string in a PDF document.- Returns:
- maximum string length
-
checkPageSize
Description copied from class:PdfACheckerChecks the allowable size of the page.- Specified by:
-
checkPageSizein classPdfAChecker - Parameters:
-
page- thePdfDictionaryof page which size being checked
-
checkFileSpec
Description copied from class:PdfACheckerVerify the conformity of the file specification dictionary.- Specified by:
-
checkFileSpecin classPdfAChecker - Parameters:
-
fileSpec- thePdfDictionarycontaining file specification to be checked
-
checkAnnotation
Verify the conformity of the annotation dictionary.- Specified by:
-
checkAnnotationin classPdfAChecker - Parameters:
-
annotDic- the annotationPdfDictionaryto be checked
-
getForbiddenAnnotations
Gets forbidden annotation types.- Returns:
- a set of forbidden annotation types
-
checkForm
Description copied from class:PdfACheckerVerify the conformity of the form dictionary.- Specified by:
-
checkFormin classPdfAChecker - Parameters:
-
form- the formPdfDictionaryto be checked
-
checkAction
Description copied from class:PdfACheckerChecks if the action is allowed.- Specified by:
-
checkActionin classPdfAChecker - Parameters:
-
action- to be checked
-
checkCatalog
Verify the conformity of the pdf catalog.- Specified by:
-
checkCatalogin classPdfAChecker - Parameters:
-
catalog- thePdfCatalogof trailer to check
-
checkCatalogValidEntries
Description copied from class:PdfACheckerChecks if entries in catalog dictionary are valid.- Specified by:
-
checkCatalogValidEntriesin classPdfAChecker - Parameters:
-
catalogDict- the catalogPdfDictionaryto be checked
-
checkPageObject
Description copied from class:PdfACheckerVerify the conformity of the page dictionary.- Specified by:
-
checkPageObjectin classPdfAChecker - Parameters:
-
pageDict- thePdfDictionaryto check -
pageResources- the page's resources dictionary
-
checkTrailer
Description copied from class:PdfACheckerVerify the conformity of the trailer dictionary.- Specified by:
-
checkTrailerin classPdfAChecker - Parameters:
-
trailer- thePdfDictionaryof trailer to check
-
getFormFields
Deprecated.in favour ofPdfCheckersUtil.getFormFields(PdfArray)- Parameters:
-
array- thePdfArrayof form fieldsPdfDictionaryobjects - Returns:
-
the
PdfArrayof form fields
-
PdfCheckersUtil.getFormFields(PdfArray)