public abstract class PdfAChecker extends Object implements IValidationChecker
| Modifier and Type | Field and Description |
|---|---|
protected Set<PdfObject> |
checkedObjects
Contains some objects that are already checked.
|
protected Map<PdfObject,PdfColorSpace> |
checkedObjectsColorspace |
protected Set<PdfObject> |
cmykUsedObjects |
protected PdfAConformance |
conformance |
protected Set<PdfObject> |
grayUsedObjects |
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 PdfStream |
pdfAOutputIntentDestProfile |
protected Set<PdfObject> |
rgbUsedObjects |
| Modifier | Constructor and Description |
|---|---|
protected |
PdfAChecker(PdfAConformance aConformance)
Creates a PdfAChecker with the required conformance.
|
| 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 |
checkCatalog(PdfCatalog catalog)
Verify the conformity of the pdf catalog.
|
protected abstract void |
checkCatalogValidEntries(PdfDictionary catalogDict)
Checks if entries in catalog dictionary are valid.
|
abstract 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.
|
abstract 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 abstract void |
checkContentStream(PdfStream contentStream)
Attest content stream conformance with appropriate specification.
|
protected void |
checkContentStreamObject(PdfObject object)
Verify the conformity of the operand of content stream with appropriate
specification.
|
abstract void |
checkCrypto(PdfObject crypto)
Verify the conformity of encryption usage.
|
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)
Deprecated.
in favour of
PdfCheckersUtil.checkFlag(int, int) |
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 catalogOrPageDict)
Verify the conformity of the output intents array in the catalog dictionary.
|
protected abstract void |
checkPageColorsUsages(PdfDictionary pageDict,
PdfDictionary pageResources)
Verify the conformity of used color spaces on the page.
|
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,
PdfObject pdfObject)
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
|
abstract void |
checkSignatureType(boolean isCAdES)
This method checks compliance of the signature type.
|
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(PdfAConformance aConformance)
Checks conformance 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.
|
abstract void |
checkText(String text,
PdfFont font)
Verify the conformity of the text written by the specified font.
|
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.
|
PdfAConformance |
getAConformance()
Gets the
PdfAConformance for this file. |
protected abstract Set<PdfName> |
getAllowedNamedActions()
Retrieve allowed actions in conforming document.
|
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 |
isPdfObjectReadyToFlush(PdfObject object)
.
|
void |
setFullCheckMode(boolean fullCheckMode)
In full check mode all objects will be tested for ISO conformance.
|
void |
setPdfAOutputIntentColorSpace(PdfDictionary catalog)
Set Pdf A output intent color space.
|
void |
validate(IValidationContext context)
.
|
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 PdfAConformance conformance
protected PdfStream pdfAOutputIntentDestProfile
protected String pdfAOutputIntentColorSpace
protected int gsStackDepth
protected Set<PdfObject> checkedObjects
Use this mechanism carefully: objects that are able to be changed (or at least if object's properties that shall be checked are able to be changed) shouldn't be marked as checked if they are not to be flushed immediately.
protected Map<PdfObject,PdfColorSpace> checkedObjectsColorspace
protected PdfAChecker(PdfAConformance aConformance)
aConformance - the required conformancepublic void checkDocument(PdfCatalog catalog)
catalog - The catalog being checkedpublic void validate(IValidationContext context)
validate in interface IValidationCheckerpublic boolean isPdfObjectReadyToFlush(PdfObject object)
isPdfObjectReadyToFlush in interface IValidationCheckerpublic void checkSinglePage(PdfPage page)
page - the page that must be checkedpublic void checkPdfObject(PdfObject obj)
obj - the COS object that must be checkedpublic PdfAConformance getAConformance()
PdfAConformance for this file.public boolean isFullCheckMode()
PdfObject.isModified()public void setFullCheckMode(boolean fullCheckMode)
fullCheckMode - is a new value for full check mode switcherPdfObject.isModified()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 checkSignatureType(boolean isCAdES)
isCAdES - true if CAdES signature type is used, false otherwisepublic abstract void checkCanvasStack(char stackOperation)
maxGsStackDepth.stackOperation - the operation to check the graphics state counter forpublic abstract void checkInlineImage(PdfStream inlineImage, PdfDictionary currentColorSpaces)
inlineImage - a PdfStream containing the inline imagecurrentColorSpaces - a PdfDictionary containing the color spaces used in the documentpublic abstract void checkColor(CanvasGraphicsState gState, Color color, PdfDictionary currentColorSpaces, Boolean fill, PdfStream contentStream)
gState - canvas graphics statecolor - the color to checkcurrentColorSpaces - a PdfDictionary containing the color spaces used in the documentfill - whether the color is used for fill or stroke operationscontentStream - current content streampublic abstract void checkColorSpace(PdfColorSpace colorSpace, PdfObject pdfObject, PdfDictionary currentColorSpaces, boolean checkAlternate, Boolean fill)
colorSpace - the color space to checkpdfObject - the pdf object to check color space incurrentColorSpaces - a PdfDictionary containing 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 operationspublic void setPdfAOutputIntentColorSpace(PdfDictionary catalog)
catalog - Catalog dictionary to retrieve the color space from.public abstract void checkRenderingIntent(PdfName intent)
intent - the intent to be analyzedpublic abstract void checkFontGlyphs(PdfFont font, PdfStream contentStream)
font - PdfFont to be checkedcontentStream - stream containing checked fontpublic abstract void checkExtGState(CanvasGraphicsState extGState, PdfStream contentStream)
extGState - the graphics state to be checkedcontentStream - current content streampublic abstract void checkFont(PdfFont pdfFont)
pdfFont - font to be checkedpublic abstract void checkXrefTable(PdfXrefTable xrefTable)
xrefTable - is the Xref tablepublic abstract void checkCrypto(PdfObject crypto)
crypto - encryption object to verifypublic abstract void checkText(String text, PdfFont font)
text - text to verifyfont - font to verify the text againstprotected abstract void checkContentStream(PdfStream contentStream)
contentStream - is a content stream to validateprotected void checkContentStreamObject(PdfObject object)
object - is an operand of content stream to validateprotected abstract long getMaxNumberOfIndirectObjects()
protected abstract Set<PdfName> getForbiddenActions()
PdfName with forbidden actionsprotected abstract Set<PdfName> getAllowedNamedActions()
PdfName with allowed named actionsprotected abstract void checkAction(PdfDictionary action)
action - to be checkedprotected abstract void checkAnnotation(PdfDictionary annotDic)
annotDic - the annotation PdfDictionary to be checkedprotected abstract void checkCatalogValidEntries(PdfDictionary catalogDict)
catalogDict - the catalog PdfDictionary to be checkedprotected abstract void checkPageColorsUsages(PdfDictionary pageDict, PdfDictionary pageResources)
pageDict - the PdfDictionary contains contents for colors to be checkedpageResources - the PdfDictionary contains resources for colors to be checkedprotected abstract void checkImage(PdfStream image, PdfDictionary currentColorSpaces)
image - the image to checkcurrentColorSpaces - the PdfDictionary containing the color spaces used in the documentprotected abstract void checkFileSpec(PdfDictionary fileSpec)
fileSpec - the PdfDictionary containing file specification to be checkedprotected abstract void checkForm(PdfDictionary form)
form - the form PdfDictionary to be checkedprotected abstract void checkFormXObject(PdfStream form)
form - the PdfStream to checkprotected abstract void checkLogicalStructure(PdfDictionary catalog)
catalog - the catalog PdfDictionary to checkprotected abstract void checkMetaData(PdfDictionary catalog)
catalog - the catalog PdfDictionary to checkprotected abstract void checkNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
trueTypeFont - the PdfTrueTypeFont to checkprotected abstract void checkOutputIntents(PdfDictionary catalogOrPageDict)
catalogOrPageDict - the PdfDictionary of a catalog or page to checkprotected abstract void checkPageObject(PdfDictionary page, PdfDictionary pageResources)
page - the PdfDictionary to checkpageResources - the page's resources dictionaryprotected abstract void checkPageSize(PdfDictionary page)
page - the PdfDictionary of page which size being checkedprotected abstract void checkPdfArray(PdfArray array)
array - the PdfArray to checkprotected abstract void checkPdfDictionary(PdfDictionary dictionary)
dictionary - the PdfDictionary to checkprotected abstract void checkPdfName(PdfName name)
name - the PdfName to checkprotected abstract void checkPdfNumber(PdfNumber number)
number - the PdfNumber to checkprotected abstract void checkPdfStream(PdfStream stream)
stream - the PdfStream to checkprotected abstract void checkPdfString(PdfString string)
string - the PdfString to checkprotected abstract void checkSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont)
trueTypeFont - the PdfTrueTypeFont to checkprotected abstract void checkTrailer(PdfDictionary trailer)
trailer - the PdfDictionary of trailer to checkprotected abstract void checkCatalog(PdfCatalog catalog)
catalog - the PdfCatalog of trailer to checkprotected abstract void checkPageTransparency(PdfDictionary pageDict, PdfDictionary pageResources)
pageDict - the PdfDictionary contains contents for transparency to be checkedpageResources - the PdfDictionary contains resources for transparency to be checkedprotected void checkResources(PdfDictionary resources, PdfObject pdfObject)
resources - the PdfDictionary to be checkedpdfObject - the pdf object to check resources for@Deprecated protected static boolean checkFlag(int flags, int flag)
PdfCheckersUtil.checkFlag(int, int)flags - a set of flags specifying various characteristics of the PDF objectflag - to be checkedprotected static boolean checkStructure(PdfAConformance aConformance)
aConformance - the PdfAConformance to be checkeda for PDF/A-1, PDF/A-2 or PDF/A-3protected static boolean isContainsTransparencyGroup(PdfDictionary dictionary)
dictionary - the PdfDictionary to checkPdfName.Group key and its value is
a dictionary with PdfName.Transparency subtypeprotected boolean isAlreadyChecked(PdfDictionary dictionary)
dictionary - the PdfDictionary to checkprotected void checkResourcesOfAppearanceStreams(PdfDictionary appearanceStreamsDict)
appearanceStreamsDict - the dictionary with appearance streams to check.Copyright © 1998–2025 Apryse Group NV. All rights reserved.