Package com.itextpdf.pdfua.checkers
Class PdfUA1Checker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.PdfUA1Checker
-
- All Implemented Interfaces:
IValidationChecker
public class PdfUA1Checker extends java.lang.Object implements IValidationChecker
The class defines the requirements of the PDF/UA-1 standard.The specification implemented by this class is ISO 14289-1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PdfUA1Checker.UaCharacterChecker
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContext
context
private HeadingsChecker
headingsChecker
private PdfDocument
pdfDocument
private TagStructureContext
tagStructureContext
-
Constructor Summary
Constructors Constructor Description PdfUA1Checker(PdfDocument pdfDocument)
Creates PdfUA1Checker instance with PDF document which will be validated against PDF/UA-1 standard.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkCatalog(PdfCatalog catalog)
private void
checkCrypto(PdfDictionary encryptionDictionary)
protected void
checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.private void
checkFonts(java.util.Collection<PdfFont> fontsInDocument)
protected void
checkMetadata(PdfCatalog catalog)
private void
checkOCGNameAndASKey(PdfDictionary dict)
private void
checkOCProperties(PdfDictionary ocProperties)
private void
checkOnOpeningBeginMarkedContent(java.lang.Object obj, java.lang.Object extra)
private void
checkOnWritingCanvasToContent(java.lang.Object data)
private void
checkPdfObject(PdfObject obj)
This method checks the requirements that must be fulfilled by a COS object in a PDF/UA document.private void
checkStandardRoleMapping(Tuple2<PdfName,PdfDictionary> tag)
private void
checkStructureTreeRoot(PdfStructTreeRoot structTreeRoot)
private void
checkText(java.lang.String str, PdfFont font)
private void
checkViewerPreferences(PdfCatalog catalog)
private java.util.Stack<Tuple2<PdfName,PdfDictionary>>
getTagStack(java.lang.Object data)
private boolean
isInsideArtifact(java.util.Stack<Tuple2<PdfName,PdfDictionary>> tagStack)
private boolean
isInsideRealContent(java.util.Stack<Tuple2<PdfName,PdfDictionary>> tagStack)
private boolean
isRealContent(Tuple2<PdfName,PdfDictionary> tag)
void
validateDocument(ValidationContext validationContext)
Validate the providedValidationContext
.void
validateObject(java.lang.Object obj, IsoKey key, PdfResources resources, PdfStream contentStream, java.lang.Object extra)
Check the provided object for conformance.
-
-
-
Field Detail
-
pdfDocument
private final PdfDocument pdfDocument
-
tagStructureContext
private final TagStructureContext tagStructureContext
-
headingsChecker
private final HeadingsChecker headingsChecker
-
context
private final PdfUAValidationContext context
-
-
Constructor Detail
-
PdfUA1Checker
public PdfUA1Checker(PdfDocument pdfDocument)
Creates PdfUA1Checker instance with PDF document which will be validated against PDF/UA-1 standard.- Parameters:
pdfDocument
- the document to validate
-
-
Method Detail
-
validateDocument
public void validateDocument(ValidationContext validationContext)
Validate the providedValidationContext
.This method is called by the
PdfDocument.close()
to check for additional conformance requirements.- Specified by:
validateDocument
in interfaceIValidationChecker
- Parameters:
validationContext
- theValidationContext
to validate
-
validateObject
public void validateObject(java.lang.Object obj, IsoKey key, PdfResources resources, PdfStream contentStream, java.lang.Object extra)
Check the provided object for conformance.This method is called by the
PdfDocument.checkIsoConformance(Object, IsoKey, PdfResources, PdfStream, Object)
to check for additional conformance requirements.- Specified by:
validateObject
in interfaceIValidationChecker
- Parameters:
obj
- the object to checkkey
- theIsoKey
of the objectresources
- thePdfResources
of the objectcontentStream
- thePdfStream
of the objectextra
- additional information
-
checkFileSpec
protected void checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.- Parameters:
fileSpec
- thePdfDictionary
containing file specification to be checked
-
checkText
private void checkText(java.lang.String str, PdfFont font)
-
checkMetadata
protected void checkMetadata(PdfCatalog catalog)
-
checkViewerPreferences
private void checkViewerPreferences(PdfCatalog catalog)
-
checkOnWritingCanvasToContent
private void checkOnWritingCanvasToContent(java.lang.Object data)
-
getTagStack
private java.util.Stack<Tuple2<PdfName,PdfDictionary>> getTagStack(java.lang.Object data)
-
checkOnOpeningBeginMarkedContent
private void checkOnOpeningBeginMarkedContent(java.lang.Object obj, java.lang.Object extra)
-
checkStandardRoleMapping
private void checkStandardRoleMapping(Tuple2<PdfName,PdfDictionary> tag)
-
isInsideArtifact
private boolean isInsideArtifact(java.util.Stack<Tuple2<PdfName,PdfDictionary>> tagStack)
-
isInsideRealContent
private boolean isInsideRealContent(java.util.Stack<Tuple2<PdfName,PdfDictionary>> tagStack)
-
isRealContent
private boolean isRealContent(Tuple2<PdfName,PdfDictionary> tag)
-
checkCatalog
private void checkCatalog(PdfCatalog catalog)
-
checkStructureTreeRoot
private void checkStructureTreeRoot(PdfStructTreeRoot structTreeRoot)
-
checkOCProperties
private void checkOCProperties(PdfDictionary ocProperties)
-
checkOCGNameAndASKey
private void checkOCGNameAndASKey(PdfDictionary dict)
-
checkFonts
private void checkFonts(java.util.Collection<PdfFont> fontsInDocument)
-
checkCrypto
private void checkCrypto(PdfDictionary encryptionDictionary)
-
checkPdfObject
private void checkPdfObject(PdfObject obj)
This method checks the requirements that must be fulfilled by a COS object in a PDF/UA document.- Parameters:
obj
- the COS object that must be checked
-
-