Class PdfUA2HeadingsChecker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2HeadingsChecker
-
public final class PdfUA2HeadingsChecker extends java.lang.Object
Utility class which performs headings check according to PDF/UA-2 specification.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfUA2HeadingsChecker.PdfUA2HeadingHandler
Handler class that checks heading tags while traversing the tag tree.
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContext
context
-
Constructor Summary
Constructors Constructor Description PdfUA2HeadingsChecker(PdfUAValidationContext context)
Creates a new instance ofPdfUA2HeadingsChecker
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkLayoutElement(IRenderer renderer)
Checks if layout element has correct heading according to PDF/UA-2 specification.void
checkStructElement(IStructureNode structNode)
Checks if layout element has correct heading according to PDF/UA-2 specification.
-
-
-
Field Detail
-
context
private final PdfUAValidationContext context
-
-
Constructor Detail
-
PdfUA2HeadingsChecker
public PdfUA2HeadingsChecker(PdfUAValidationContext context)
Creates a new instance ofPdfUA2HeadingsChecker
.- Parameters:
context
- the validation context
-
-
Method Detail
-
checkLayoutElement
public void checkLayoutElement(IRenderer renderer)
Checks if layout element has correct heading according to PDF/UA-2 specification.Conforming files shall use the explicitly numbered heading structure types (H1-Hn) and shall not use the H structure type.
Note, that PDF/UA-2 specification does not include requirements on the use of sequential heading levels. But where a heading’s level is evident, the heading level of the structure element enclosing it shall match that heading level, e.g. a heading with the real content “5.1.6.4 Some header” is evidently at heading level 4. This requirement is not checked.
- Parameters:
renderer
- layout element to check- Throws:
PdfUAConformanceException
- if document uses the H structure type
-
checkStructElement
public void checkStructElement(IStructureNode structNode)
Checks if layout element has correct heading according to PDF/UA-2 specification.Conforming files shall use the explicitly numbered heading structure types (H1-Hn) and shall not use the H structure type.
Note, that PDF/UA-2 specification does not include requirements on the use of sequential heading levels. But where a heading’s level is evident, the heading level of the structure element enclosing it shall match that heading level, e.g. a heading with the real content “5.1.6.4 Some header” is evidently at heading level 4. This requirement is not checked.
- Parameters:
structNode
- structure element to check- Throws:
PdfUAConformanceException
- if document uses the H structure type
-
-