public abstract class PdfAChecker extends Object
Modifier and Type | Field and Description |
---|---|
protected Set<PdfObject> |
checkedObjects
Contains some objects that are already checked.
|
protected Map<PdfObject,PdfColorSpace> |
checkedObjectsColorspace |
protected boolean |
cmykIsUsed |
protected PdfAConformanceLevel |
conformanceLevel |
protected boolean |
grayIsUsed |
protected int |
gsStackDepth |
static String |
ICC_COLOR_SPACE_CMYK
The Cyan-Magenta-Yellow-Key (black) color profile as defined by the International Color Consortium.
|
static String |
ICC_COLOR_SPACE_GRAY
The Grayscale color profile as defined by the International Color Consortium.
|
static String |
ICC_COLOR_SPACE_RGB
The Red-Green-Blue color profile as defined by the International Color Consortium.
|
static String |
ICC_DEVICE_CLASS_MONITOR_PROFILE
The Monitor device class
|
static String |
ICC_DEVICE_CLASS_OUTPUT_PROFILE
The Output device class
|
static int |
maxGsStackDepth
The maximum Graphics State stack depth in PDF/A documents, i.e.
|
protected String |
pdfAOutputIntentColorSpace |
protected boolean |
rgbIsUsed |
Modifier | Constructor and Description |
---|---|
protected |
PdfAChecker(PdfAConformanceLevel conformanceLevel)
Creates a PdfAChecker with the required conformance level.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkAction(PdfDictionary action)
Checks if the action is allowed.
|
protected abstract void |
checkAnnotation(PdfDictionary annotDic)
Verify the conformity of the annotation dictionary.
|
protected void |
checkAppearanceStream(PdfStream appearanceStream)
Check single annotation appearance stream.
|
abstract void |
checkCanvasStack(char stackOperation)
This method checks compliance with the graphics state architectural limitation, explained by maxGsStackDepth .
|
protected abstract void |
checkCatalogValidEntries(PdfDictionary catalogDict)
Checks if entries in catalog dictionary are valid.
|
abstract void |
checkColor(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.
|
abstract void |
checkColorSpace(PdfColorSpace colorSpace, 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 abstract void |
checkColorsUsages()
Verify the conformity of used color spaces.
|
protected abstract void |
checkContentStream(PdfStream contentStream)
Attest content stream conformance with appropriate specification.
|
protected abstract void |
checkContentStreamObject(PdfObject object)
Verify the conformity of the operand of content stream with appropriate specification.
|
void |
checkDocument(PdfCatalog catalog)
This method checks a number of document-wide requirements of the PDF/A standard.
|
abstract 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 abstract void |
checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.
|
protected static boolean |
checkFlag(int flags, int flag)
Checks if the specified flag is set.
|
abstract void |
checkFont(PdfFont pdfFont)
Performs a number of checks on the font.
|
abstract void |
checkFontGlyphs(PdfFont font, PdfStream contentStream)
Performs a check of the each font glyph as a Form XObject.
|
protected abstract void |
checkForm(PdfDictionary form)
Verify the conformity of the form dictionary.
|
protected abstract void |
checkFormXObject(PdfStream form)
Verify the conformity of the form XObject dictionary.
|
protected abstract void |
checkImage(PdfStream image, PdfDictionary currentColorSpaces)
Verify the conformity of the given image.
|
abstract void |
checkInlineImage(PdfStream inlineImage, PdfDictionary currentColorSpaces)
This method checks compliance with the inline image restrictions in the PDF/A specs, specifically filter parameters.
|
protected abstract void |
checkLogicalStructure(PdfDictionary catalog)
Performs a number of checks on the logical structure of the document.
|
protected abstract void |
checkMetaData(PdfDictionary catalog)
Performs a number of checks on the metadata of the document.
|
protected abstract void |
checkNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
Verify the conformity of the non-symbolic TrueType font.
|
protected abstract void |
checkOutputIntents(PdfDictionary catalog)
Verify the conformity of the output intents array in the catalog dictionary.
|
protected abstract void |
checkPageObject(PdfDictionary page, PdfDictionary pageResources)
Verify the conformity of the page dictionary.
|
protected abstract void |
checkPageSize(PdfDictionary page)
Checks the allowable size of the page.
|
protected abstract void |
checkPageTransparency(PdfDictionary pageDict, PdfDictionary pageResources)
Verify the conformity of the page transparency.
|
protected abstract void |
checkPdfArray(PdfArray array)
Verify the conformity of the PDF array.
|
protected abstract void |
checkPdfDictionary(PdfDictionary dictionary)
Verify the conformity of the PDF dictionary.
|
protected abstract void |
checkPdfName(PdfName name)
Verify the conformity of the PDF name.
|
protected abstract void |
checkPdfNumber(PdfNumber number)
Verify the conformity of the PDF number.
|
void |
checkPdfObject(PdfObject obj)
This method checks the requirements that must be fulfilled by a COS object in a PDF/A document.
|
protected abstract void |
checkPdfStream(PdfStream stream)
Verify the conformity of the PDF stream.
|
protected abstract void |
checkPdfString(PdfString string)
Verify the conformity of the PDF string.
|
abstract void |
checkRenderingIntent(PdfName intent)
Checks whether the rendering intent of the document is within the allowed range of intents.
|
protected void |
checkResources(PdfDictionary resources)
Verify the conformity of the resources dictionary.
|
protected void |
checkResourcesOfAppearanceStreams(PdfDictionary appearanceStreamsDict)
Checks resources of the appearance streams.
|
void |
checkSignature(PdfDictionary signatureDict)
This method checks compliance of the signature dictionary
|
void |
checkSinglePage(PdfPage page)
This method checks all requirements that must be fulfilled by a page in a PDF/A document.
|
protected static boolean |
checkStructure(PdfAConformanceLevel conformanceLevel)
Checks conformance level of PDF/A standard.
|
protected abstract void |
checkSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
Verify the conformity of the symbolic TrueType font.
|
void |
checkTagStructureElement(PdfObject obj)
This method checks compliance of the tag structure elements, such as struct elements or parent tree entries.
|
protected abstract void |
checkTrailer(PdfDictionary trailer)
Verify the conformity of the trailer dictionary.
|
abstract void |
checkXrefTable(PdfXrefTable xrefTable)
Verify the conformity of the cross-reference table.
|
protected abstract Set<PdfName> |
getAllowedNamedActions()
Retrieve allowed actions in conforming document.
|
PdfAConformanceLevel |
getConformanceLevel()
Gets the PdfAConformanceLevel for this file.
|
protected abstract Set<PdfName> |
getForbiddenActions()
Retrieve forbidden actions in conforming document.
|
protected abstract long |
getMaxNumberOfIndirectObjects()
Retrieve maximum allowed number of indirect objects in conforming document.
|
protected boolean |
isAlreadyChecked(PdfDictionary dictionary)
Checks whether the specified dictionary was already checked.
|
protected static boolean |
isContainsTransparencyGroup(PdfDictionary dictionary)
Checks whether the specified dictionary has a transparency group.
|
boolean |
isFullCheckMode()
In full check mode all objects will be tested for ISO conformance.
|
boolean |
objectIsChecked(PdfObject object)
Remembers which objects have already been checked, in order to avoid redundant checks.
|
void |
setFullCheckMode(boolean fullCheckMode)
In full check mode all objects will be tested for ISO conformance.
|
public static final String ICC_COLOR_SPACE_RGB
public static final String ICC_COLOR_SPACE_CMYK
public static final String ICC_COLOR_SPACE_GRAY
public static final String ICC_DEVICE_CLASS_OUTPUT_PROFILE
public static final String ICC_DEVICE_CLASS_MONITOR_PROFILE
public static final int maxGsStackDepth
q
that may be opened (i.e. not yet closed by a corresponding Q
) at any point in a content stream sequence. Defined as 28 by PDF/A-1 section 6.1.12, by referring to the PDF spec Appendix C table 1 "architectural limits".
protected PdfAConformanceLevel conformanceLevel
protected String pdfAOutputIntentColorSpace
protected int gsStackDepth
protected boolean rgbIsUsed
protected boolean cmykIsUsed
protected boolean grayIsUsed
protected Set<PdfObject> checkedObjects
protected Map<PdfObject,PdfColorSpace> checkedObjectsColorspace
protected PdfAChecker(PdfAConformanceLevel conformanceLevel)
conformanceLevel
- the required conformance level
public void checkDocument(PdfCatalog catalog)
catalog
- The catalog being checked
public void checkSinglePage(PdfPage page)
page
- the page that must be checked
public void checkPdfObject(PdfObject obj)
obj
- the COS object that must be checked
public PdfAConformanceLevel getConformanceLevel()
PdfAConformanceLevel
for this file.
public boolean isFullCheckMode()
PdfObject.isModified()
public void setFullCheckMode(boolean fullCheckMode)
fullCheckMode
- is a new value for full check mode switcher
PdfObject.isModified()
public boolean objectIsChecked(PdfObject object)
object
- the object to check
public void checkTagStructureElement(PdfObject obj)
obj
- an object that represents tag structure element.
public void checkSignature(PdfDictionary signatureDict)
signatureDict
- a PdfDictionary
containing the signature.
public abstract void checkCanvasStack(char stackOperation)
maxGsStackDepth
.
stackOperation
- the operation to check the graphics state counter for
public abstract void checkInlineImage(PdfStream inlineImage, PdfDictionary currentColorSpaces)
inlineImage
- a PdfStream
containing the inline image
currentColorSpaces
- a PdfDictionary
containing the color spaces used in the document
public abstract void checkColor(Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream contentStream)
color
- the color to check
currentColorSpaces
- a PdfDictionary
containing the color spaces used in the document
fill
- whether the color is used for fill or stroke operations
contentStream
- current content stream
public abstract void checkColorSpace(PdfColorSpace colorSpace, PdfDictionary currentColorSpaces, boolean checkAlternate, Boolean fill)
colorSpace
- the color space to check
currentColorSpaces
- a PdfDictionary
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
public abstract void checkRenderingIntent(PdfName intent)
intent
- the intent to be analyzed
public abstract void checkFontGlyphs(PdfFont font, PdfStream contentStream)
font
- PdfFont
to be checked
contentStream
- stream containing checked font
public abstract void checkExtGState(CanvasGraphicsState extGState, PdfStream contentStream)
extGState
- the graphics state to be checked
contentStream
- current content stream
public abstract void checkFont(PdfFont pdfFont)
pdfFont
- font to be checked
public abstract void checkXrefTable(PdfXrefTable xrefTable)
xrefTable
- is the Xref table
protected abstract void checkContentStream(PdfStream contentStream)
contentStream
- is a content stream to validate
protected abstract void checkContentStreamObject(PdfObject object)
object
- is an operand of content stream to validate
protected abstract long getMaxNumberOfIndirectObjects()
protected abstract Set<PdfName> getForbiddenActions()
PdfName
with forbidden actions
protected abstract Set<PdfName> getAllowedNamedActions()
PdfName
with allowed named actions
protected abstract void checkAction(PdfDictionary action)
action
- to be checked
protected abstract void checkAnnotation(PdfDictionary annotDic)
annotDic
- the annotation PdfDictionary
to be checked
protected abstract void checkCatalogValidEntries(PdfDictionary catalogDict)
catalogDict
- the catalog PdfDictionary
to be checked
protected abstract void checkColorsUsages()
protected abstract void checkImage(PdfStream image, PdfDictionary currentColorSpaces)
image
- the image to check
currentColorSpaces
- the PdfDictionary
containing the color spaces used in the document
protected abstract void checkFileSpec(PdfDictionary fileSpec)
fileSpec
- the PdfDictionary
containing file specification to be checked
protected abstract void checkForm(PdfDictionary form)
form
- the form PdfDictionary
to be checked
protected abstract void checkFormXObject(PdfStream form)
form
- the PdfStream
to check
protected abstract void checkLogicalStructure(PdfDictionary catalog)
catalog
- the catalog PdfDictionary
to check
protected abstract void checkMetaData(PdfDictionary catalog)
catalog
- the catalog PdfDictionary
to check
protected abstract void checkNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
trueTypeFont
- the PdfTrueTypeFont
to check
protected abstract void checkOutputIntents(PdfDictionary catalog)
catalog
- the PdfDictionary
to check
protected abstract void checkPageObject(PdfDictionary page, PdfDictionary pageResources)
page
- the PdfDictionary
to check
pageResources
- the page's resources dictionary
protected abstract void checkPageSize(PdfDictionary page)
page
- the PdfDictionary
of page which size being checked
protected abstract void checkPdfArray(PdfArray array)
array
- the PdfArray
to check
protected abstract void checkPdfDictionary(PdfDictionary dictionary)
dictionary
- the PdfDictionary
to check
protected abstract void checkPdfName(PdfName name)
name
- the PdfName
to check
protected abstract void checkPdfNumber(PdfNumber number)
number
- the PdfNumber
to check
protected abstract void checkPdfStream(PdfStream stream)
stream
- the PdfStream
to check
protected abstract void checkPdfString(PdfString string)
string
- the PdfString
to check
protected abstract void checkSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
trueTypeFont
- the PdfTrueTypeFont
to check
protected abstract void checkTrailer(PdfDictionary trailer)
trailer
- the PdfDictionary
of trailer to check
protected abstract void checkPageTransparency(PdfDictionary pageDict, PdfDictionary pageResources)
pageDict
- the PdfDictionary
contains contents for transparency to be checked
pageResources
- the PdfDictionary
contains resources for transparency to be checked
protected void checkResources(PdfDictionary resources)
resources
- the PdfDictionary
to be checked
protected static boolean checkFlag(int flags, int flag)
flags
- a set of flags specifying various characteristics of the PDF object
flag
- to be checked
protected static boolean checkStructure(PdfAConformanceLevel conformanceLevel)
conformanceLevel
- the PdfAConformanceLevel
to be checked
a
for PDF/A-1, PDF/A-2 or PDF/A-3
protected static boolean isContainsTransparencyGroup(PdfDictionary dictionary)
dictionary
- the PdfDictionary
to check
PdfName.Group
key and its value is a dictionary with PdfName.Transparency
subtype
protected boolean isAlreadyChecked(PdfDictionary dictionary)
dictionary
- the PdfDictionary
to check
protected void checkResourcesOfAppearanceStreams(PdfDictionary appearanceStreamsDict)
appearanceStreamsDict
- the dictionary with appearance streams to check.
Copyright © 1998–2022 iText Group NV. All rights reserved.