public class TrailerValidationProcess extends AbstractProcess
| Constructor and Description |
|---|
TrailerValidationProcess() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkLinearizedDictionnary(PreflightContext ctx,
COSDictionary linearizedDict)
Check if mandatory keys of linearized dictionary are present.
|
protected void |
checkMainTrailer(PreflightContext ctx,
COSDictionary trailer)
check if all keys are authorized in a trailer dictionary and if the type is valid.
|
protected void |
checkTrailersForLinearizedPDF14(PreflightContext ctx)
Extracts and compares first and last trailers for PDF version between 1.1 and 1.4.
|
protected void |
checkTrailersForLinearizedPDF15(PreflightContext ctx)
Accesses and compares First and Last trailers for a PDF version higher than 1.4.
|
protected boolean |
compareIds(COSDictionary first,
COSDictionary last,
COSDocument cosDocument)
Return true if the ID of the first dictionary is the same as the id of the last dictionary Return false
otherwise.
|
protected COSDictionary |
getLinearizedDictionary(PDDocument document)
According to the PDF Reference, A linearized PDF contain a dictionary as first object (linearized dictionary) and
only this one in the first section.
|
void |
validate(PreflightContext ctx) |
addFontError, addValidationError, addValidationErrorspublic void validate(PreflightContext ctx) throws ValidationException
ValidationExceptionprotected void checkTrailersForLinearizedPDF14(PreflightContext ctx)
ctx - the preflight context.protected void checkTrailersForLinearizedPDF15(PreflightContext ctx)
ctx - the preflight context.protected boolean compareIds(COSDictionary first, COSDictionary last, COSDocument cosDocument)
first - the first dictionary for comparison.last - the last dictionary for comparison.cosDocument - the document.protected void checkMainTrailer(PreflightContext ctx, COSDictionary trailer)
ctx - the preflight context.trailer - the trailer dictionary.protected COSDictionary getLinearizedDictionary(PDDocument document)
document - the document to validate.protected void checkLinearizedDictionnary(PreflightContext ctx, COSDictionary linearizedDict)
ctx - the preflight context.linearizedDict - the linearization dictionary.Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.