Package com.itextpdf.pdfa.checker
Class PdfA1Checker
java.lang.Object
com.itextpdf.pdfa.checker.PdfAChecker
com.itextpdf.pdfa.checker.PdfA1Checker
- 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
Modifier and TypeFieldDescriptionFields inherited from class com.itextpdf.pdfa.checker.PdfAChecker
checkedObjects, checkedObjectsColorspace, cmykIsUsed, cmykUsedObjects, conformanceLevel, grayIsUsed, 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, rgbIsUsed, rgbUsedObjects
-
Constructor Summary
ConstructorDescriptionPdfA1Checker
(PdfAConformanceLevel conformanceLevel) Creates a PdfA1Checker with the required conformance level -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkAction
(PdfDictionary action) Checks if the action is allowed.protected void
checkAnnotation
(PdfDictionary annotDic) Verify the conformity of the annotation dictionary.void
checkCanvasStack
(char stackOperation) This method checks compliance with the graphics state architectural limitation, explained byPdfAChecker.maxGsStackDepth
.protected void
checkCatalog
(PdfCatalog catalog) Verify the conformity of the pdf catalog.protected void
checkCatalogValidEntries
(PdfDictionary catalogDict) Checks if entries in catalog dictionary are valid.void
checkColor
(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.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.protected void
Verify the conformity of used color spaces.protected void
checkContentStream
(PdfStream contentStream) Attest content stream conformance with appropriate specification.void
checkCrypto
(PdfObject crypto) Verify the conformity of encryption usage.void
checkExtGState
(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 void
checkFileSpec
(PdfDictionary fileSpec) Verify the conformity of the file specification dictionary.void
Performs a number of checks on the font.void
checkFontGlyphs
(PdfFont font, PdfStream contentStream) Performs a check of the each font glyph as a Form XObject.protected void
checkForm
(PdfDictionary form) Verify the conformity of the form dictionary.protected void
checkFormXObject
(PdfStream form) Verify the conformity of the form XObject dictionary.protected void
checkImage
(PdfStream image, PdfDictionary currentColorSpaces) Verify the conformity of the given image.void
checkInlineImage
(PdfStream inlineImage, PdfDictionary currentColorSpaces) This method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.protected void
checkLogicalStructure
(PdfDictionary catalog) Performs a number of checks on the logical structure of the document.protected void
checkMetaData
(PdfDictionary catalog) Performs a number of checks on the metadata of the document.protected void
checkNonSymbolicTrueTypeFont
(PdfTrueTypeFont trueTypeFont) Verify the conformity of the non-symbolic TrueType font.protected void
checkOutputIntents
(PdfDictionary catalog) Verify the conformity of the output intents array in the catalog dictionary.protected void
checkPageColorsUsages
(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of used color spaces on the page.protected void
checkPageObject
(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of the page dictionary.protected void
checkPageSize
(PdfDictionary page) Checks the allowable size of the page.protected void
checkPageTransparency
(PdfDictionary pageDict, PdfDictionary pageResources) Verify the conformity of the page transparency.protected void
checkPdfArray
(PdfArray array) Verify the conformity of the PDF array.protected void
checkPdfDictionary
(PdfDictionary dictionary) Verify the conformity of the PDF dictionary.protected void
checkPdfName
(PdfName name) Verify the conformity of the PDF name.protected void
checkPdfNumber
(PdfNumber number) Verify the conformity of the PDF number.protected void
checkPdfStream
(PdfStream stream) Verify the conformity of the PDF stream.protected void
checkPdfString
(PdfString string) Verify the conformity of the PDF string.void
checkRenderingIntent
(PdfName intent) Checks whether the rendering intent of the document is within the allowed range of intents.void
checkSignatureType
(boolean isCAdES) This method checks compliance of the signature typeprotected void
checkSymbolicTrueTypeFont
(PdfTrueTypeFont trueTypeFont) Verify the conformity of the symbolic TrueType font.void
Verify the conformity of the text written by the specified font.protected void
checkTrailer
(PdfDictionary trailer) Verify the conformity of the trailer dictionary.void
checkXrefTable
(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 PdfArray
getFormFields
(PdfArray array) protected long
Retrieve maximal allowed integer value.protected int
Retrieve maximum allowed length of the name object.protected long
Retrieve maximum allowed number of indirect objects in conforming document.protected double
Retrieve maximum allowed real value.protected int
Returns maximum allowed bytes length of the string in a PDF document.protected long
Retrieve minimal allowed integer value.Methods inherited from class com.itextpdf.pdfa.checker.PdfAChecker
checkAppearanceStream, checkColorSpace, checkContentStreamObject, checkDocument, checkFlag, checkPdfObject, checkResources, checkResources, checkResourcesOfAppearanceStreams, checkSignature, checkSinglePage, checkStructure, checkTagStructureElement, getConformanceLevel, isAlreadyChecked, isContainsTransparencyGroup, isFullCheckMode, objectIsChecked, setFullCheckMode, setPdfAOutputIntentColorSpace
-
Field Details
-
forbiddenAnnotations
-
contentAnnotations
-
forbiddenActions
-
allowedNamedActions
-
allowedRenderingIntents
-
-
Constructor Details
-
PdfA1Checker
Creates a PdfA1Checker with the required conformance level- Parameters:
-
conformanceLevel
- the required conformance level,a
orb
-
-
Method Details
-
checkCanvasStack
public void checkCanvasStack(char stackOperation) Description copied from class:PdfAChecker
This method checks compliance with the graphics state architectural limitation, explained byPdfAChecker.maxGsStackDepth
.- Specified by:
-
checkCanvasStack
in classPdfAChecker
- Parameters:
-
stackOperation
- the operation to check the graphics state counter for
-
checkInlineImage
Description copied from class:PdfAChecker
This method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.- Specified by:
-
checkInlineImage
in classPdfAChecker
- Parameters:
-
inlineImage
- aPdfStream
containing the inline image -
currentColorSpaces
- aPdfDictionary
containing the color spaces used in the document
-
checkColor
public void checkColor(Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream stream) Description copied from class:PdfAChecker
This method checks compliance with the color restrictions imposed by the available color spaces in the document. This method will be abstract in update 7.2- Specified by:
-
checkColor
in classPdfAChecker
- Parameters:
-
color
- the color to check -
currentColorSpaces
- aPdfDictionary
containing 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.- Overrides:
-
checkColorSpace
in classPdfAChecker
- Parameters:
-
colorSpace
- the color space to check -
pdfObject
- the pdf object to check color space in -
currentColorSpaces
- aPdfDictionary
containing 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:PdfAChecker
Verify the conformity of the cross-reference table.- Specified by:
-
checkXrefTable
in classPdfAChecker
- Parameters:
-
xrefTable
- is the Xref table
-
getForbiddenActions
Description copied from class:PdfAChecker
Retrieve forbidden actions in conforming document.- Specified by:
-
getForbiddenActions
in classPdfAChecker
- Returns:
-
set of
PdfName
with forbidden actions
-
getAllowedNamedActions
Description copied from class:PdfAChecker
Retrieve allowed actions in conforming document.- Specified by:
-
getAllowedNamedActions
in classPdfAChecker
- Returns:
-
set of
PdfName
with allowed named actions
-
getMaxNumberOfIndirectObjects
protected long getMaxNumberOfIndirectObjects()Description copied from class:PdfAChecker
Retrieve maximum allowed number of indirect objects in conforming document.- Specified by:
-
getMaxNumberOfIndirectObjects
in classPdfAChecker
- Returns:
- maximum allowed number of indirect objects
-
checkColorsUsages
protected void checkColorsUsages()Verify the conformity of used color spaces.- Specified by:
-
checkColorsUsages
in classPdfAChecker
-
checkPageColorsUsages
Verify the conformity of used color spaces on the page.- Overrides:
-
checkPageColorsUsages
in classPdfAChecker
- Parameters:
-
pageDict
- thePdfDictionary
contains contents for colors to be checked. -
pageResources
- thePdfDictionary
contains resources for colors to be checked.
-
checkExtGState
Description copied from class:PdfAChecker
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. This method will be abstract in the update 7.2- Specified by:
-
checkExtGState
in classPdfAChecker
- Parameters:
-
extGState
- the graphics state to be checked -
contentStream
- current content stream
-
checkFontGlyphs
Description copied from class:PdfAChecker
Performs 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:
-
checkFontGlyphs
in classPdfAChecker
- Parameters:
-
font
-PdfFont
to be checked -
contentStream
- stream containing checked font
-
checkRenderingIntent
Description copied from class:PdfAChecker
Checks 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:
-
checkRenderingIntent
in classPdfAChecker
- Parameters:
-
intent
- the intent to be analyzed
-
checkFont
Description copied from class:PdfAChecker
Performs 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:
-
checkFont
in classPdfAChecker
- Parameters:
-
pdfFont
- font to be checked
-
checkCrypto
Verify the conformity of encryption usage.- Overrides:
-
checkCrypto
in classPdfAChecker
- Parameters:
-
crypto
- Encryption object to verify.
-
checkSignatureType
public void checkSignatureType(boolean isCAdES) This method checks compliance of the signature type- Overrides:
-
checkSignatureType
in classPdfAChecker
- Parameters:
-
isCAdES
- true is CAdES sig type is used, false otherwise.
-
checkText
Verify the conformity of the text written by the specified font.- Overrides:
-
checkText
in classPdfAChecker
- Parameters:
-
text
- Text to verify. -
font
- Font to verify the text against.
-
checkPageTransparency
Description copied from class:PdfAChecker
Verify the conformity of the page transparency.- Specified by:
-
checkPageTransparency
in classPdfAChecker
- Parameters:
-
pageDict
- thePdfDictionary
contains contents for transparency to be checked -
pageResources
- thePdfDictionary
contains resources for transparency to be checked
-
checkContentStream
Description copied from class:PdfAChecker
Attest content stream conformance with appropriate specification. Throws PdfAConformanceException if any discrepancy was found- Specified by:
-
checkContentStream
in classPdfAChecker
- Parameters:
-
contentStream
- is a content stream to validate
-
checkNonSymbolicTrueTypeFont
Description copied from class:PdfAChecker
Verify the conformity of the non-symbolic TrueType font.- Specified by:
-
checkNonSymbolicTrueTypeFont
in classPdfAChecker
- Parameters:
-
trueTypeFont
- thePdfTrueTypeFont
to check
-
checkSymbolicTrueTypeFont
Description copied from class:PdfAChecker
Verify the conformity of the symbolic TrueType font.- Specified by:
-
checkSymbolicTrueTypeFont
in classPdfAChecker
- Parameters:
-
trueTypeFont
- thePdfTrueTypeFont
to check
-
checkImage
Description copied from class:PdfAChecker
Verify the conformity of the given image.- Specified by:
-
checkImage
in classPdfAChecker
- Parameters:
-
image
- the image to check -
currentColorSpaces
- thePdfDictionary
containing the color spaces used in the document
-
checkFormXObject
Description copied from class:PdfAChecker
Verify the conformity of the form XObject dictionary.- Specified by:
-
checkFormXObject
in classPdfAChecker
- Parameters:
-
form
- thePdfStream
to check
-
checkLogicalStructure
Description copied from class:PdfAChecker
Performs a number of checks on the logical structure of the document.- Specified by:
-
checkLogicalStructure
in classPdfAChecker
- Parameters:
-
catalog
- the catalogPdfDictionary
to check
-
checkMetaData
Description copied from class:PdfAChecker
Performs a number of checks on the metadata of the document.- Specified by:
-
checkMetaData
in classPdfAChecker
- Parameters:
-
catalog
- the catalogPdfDictionary
to check
-
checkOutputIntents
Description copied from class:PdfAChecker
Verify the conformity of the output intents array in the catalog dictionary.- Specified by:
-
checkOutputIntents
in classPdfAChecker
- Parameters:
-
catalog
- thePdfDictionary
to check
-
checkPdfNumber
Description copied from class:PdfAChecker
Verify the conformity of the PDF number.- Specified by:
-
checkPdfNumber
in classPdfAChecker
- Parameters:
-
number
- thePdfNumber
to 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:PdfAChecker
Verify the conformity of the PDF array.- Specified by:
-
checkPdfArray
in classPdfAChecker
- Parameters:
-
array
- thePdfArray
to check
-
checkPdfDictionary
Description copied from class:PdfAChecker
Verify the conformity of the PDF dictionary.- Specified by:
-
checkPdfDictionary
in classPdfAChecker
- Parameters:
-
dictionary
- thePdfDictionary
to check
-
checkPdfStream
Description copied from class:PdfAChecker
Verify the conformity of the PDF stream.- Specified by:
-
checkPdfStream
in classPdfAChecker
- Parameters:
-
stream
- thePdfStream
to check
-
checkPdfName
Description copied from class:PdfAChecker
Verify the conformity of the PDF name.- Specified by:
-
checkPdfName
in classPdfAChecker
- Parameters:
-
name
- thePdfName
to 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:PdfAChecker
Verify the conformity of the PDF string.- Specified by:
-
checkPdfString
in classPdfAChecker
- Parameters:
-
string
- thePdfString
to 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:PdfAChecker
Checks the allowable size of the page.- Specified by:
-
checkPageSize
in classPdfAChecker
- Parameters:
-
page
- thePdfDictionary
of page which size being checked
-
checkFileSpec
Description copied from class:PdfAChecker
Verify the conformity of the file specification dictionary.- Specified by:
-
checkFileSpec
in classPdfAChecker
- Parameters:
-
fileSpec
- thePdfDictionary
containing file specification to be checked
-
checkAnnotation
Verify the conformity of the annotation dictionary.- Specified by:
-
checkAnnotation
in classPdfAChecker
- Parameters:
-
annotDic
- the annotationPdfDictionary
to be checked
-
getForbiddenAnnotations
Gets forbidden annotation types.- Returns:
- a set of forbidden annotation types
-
checkForm
Description copied from class:PdfAChecker
Verify the conformity of the form dictionary.- Specified by:
-
checkForm
in classPdfAChecker
- Parameters:
-
form
- the formPdfDictionary
to be checked
-
checkAction
Description copied from class:PdfAChecker
Checks if the action is allowed.- Specified by:
-
checkAction
in classPdfAChecker
- Parameters:
-
action
- to be checked
-
checkCatalog
Verify the conformity of the pdf catalog.- Overrides:
-
checkCatalog
in classPdfAChecker
- Parameters:
-
catalog
- thePdfCatalog
of trailer to check.
-
checkCatalogValidEntries
Description copied from class:PdfAChecker
Checks if entries in catalog dictionary are valid.- Specified by:
-
checkCatalogValidEntries
in classPdfAChecker
- Parameters:
-
catalogDict
- the catalogPdfDictionary
to be checked
-
checkPageObject
Description copied from class:PdfAChecker
Verify the conformity of the page dictionary.- Specified by:
-
checkPageObject
in classPdfAChecker
- Parameters:
-
pageDict
- thePdfDictionary
to check -
pageResources
- the page's resources dictionary
-
checkTrailer
Description copied from class:PdfAChecker
Verify the conformity of the trailer dictionary.- Specified by:
-
checkTrailer
in classPdfAChecker
- Parameters:
-
trailer
- thePdfDictionary
of trailer to check
-
getFormFields
- Parameters:
-
array
- thePdfArray
of form fieldsPdfDictionary
objects - Returns:
-
the
PdfArray
of form fields
-