Class ExtGStateValidationProcess
- java.lang.Object
-
- org.apache.pdfbox.preflight.process.AbstractProcess
-
- org.apache.pdfbox.preflight.process.reflect.ExtGStateValidationProcess
-
- All Implemented Interfaces:
ValidationProcess
public class ExtGStateValidationProcess extends AbstractProcess
-
-
Constructor Summary
Constructors Constructor Description ExtGStateValidationProcess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckBlendMode(PreflightContext context, COSDictionary egs)This method checks the BM value of the ExtGState dictionary.private voidcheckFont(PreflightContext context, COSDictionary egs)This method checks a Font array in the ExtGState dictionary.private voidcheckLowerCA(PreflightContext context, COSDictionary egs)This method checks the "ca" value of the ExtGState dictionary.private voidcheckSoftMask(PreflightContext context, COSDictionary egs)This method checks the SMask value of the ExtGState dictionary.protected voidcheckTR2Key(PreflightContext context, COSDictionary egs)Check the TR2 entry.protected voidcheckTRKey(PreflightContext context, COSDictionary egs)Check the TR entry.private voidcheckUpperCA(PreflightContext context, COSDictionary egs)This method checks the "CA" value of the ExtGState dictionary.java.util.List<COSDictionary>extractExtGStateDictionaries(COSDictionary extGStates)Create a list of ExtGState dictionaries using the given Resource dictionary and the COSDocument.voidvalidate(PreflightContext context)Validate the ExtGState dictionaries.protected voidvalidateFonts(PreflightContext context, java.util.List<COSDictionary> listOfExtGState)Validate fonts in all ExtGState dictionaries of this container.protected voidvalidateTransparencyRules(PreflightContext context, java.util.List<COSDictionary> listOfExtGState)Validate transparency rules in all ExtGState dictionaries of this container.-
Methods inherited from class org.apache.pdfbox.preflight.process.AbstractProcess
addFontError, addValidationError, addValidationErrors
-
-
-
-
Method Detail
-
validate
public void validate(PreflightContext context) throws ValidationException
Validate the ExtGState dictionaries.- Parameters:
context- the context which contains the Resource dictionary.- Throws:
ValidationException- thrown if an Extended Graphic State isn't valid.
-
extractExtGStateDictionaries
public java.util.List<COSDictionary> extractExtGStateDictionaries(COSDictionary extGStates) throws ValidationException
Create a list of ExtGState dictionaries using the given Resource dictionary and the COSDocument.- Parameters:
extGStates- a resource COSDictionary.- Returns:
- the list of ExtGState dictionaries.
- Throws:
ValidationException- thrown if an Extended Graphic State isn't valid.
-
validateTransparencyRules
protected void validateTransparencyRules(PreflightContext context, java.util.List<COSDictionary> listOfExtGState)
Validate transparency rules in all ExtGState dictionaries of this container.- Parameters:
context- the preflight context.listOfExtGState- a list of ExtGState COSDictionaries.
-
validateFonts
protected void validateFonts(PreflightContext context, java.util.List<COSDictionary> listOfExtGState) throws ValidationException
Validate fonts in all ExtGState dictionaries of this container.- Parameters:
context- the preflight context.listOfExtGState- a list of ExtGState COSDictionaries.- Throws:
ValidationException
-
checkFont
private void checkFont(PreflightContext context, COSDictionary egs) throws ValidationException
This method checks a Font array in the ExtGState dictionary.- Parameters:
context- the preflight context.egs- the Graphic state to check- Throws:
ValidationException
-
checkSoftMask
private void checkSoftMask(PreflightContext context, COSDictionary egs)
This method checks the SMask value of the ExtGState dictionary. The Soft Mask is optional but must be "None" if it is present.- Parameters:
context- the preflight context.egs- the Graphic state to check
-
checkBlendMode
private void checkBlendMode(PreflightContext context, COSDictionary egs)
This method checks the BM value of the ExtGState dictionary. The Blend Mode is optional but must be "Normal" or "Compatible" if it is present.- Parameters:
context- the preflight context * @param egs the graphic state to check
-
checkUpperCA
private void checkUpperCA(PreflightContext context, COSDictionary egs)
This method checks the "CA" value of the ExtGState dictionary. It is optional but must be 1.0 if present.- Parameters:
context- the preflight context.egs- the graphic state to check
-
checkLowerCA
private void checkLowerCA(PreflightContext context, COSDictionary egs)
This method checks the "ca" value of the ExtGState dictionary. It is optional but must be 1.0 if present.- Parameters:
context- the preflight context.egs- the graphic state to check
-
checkTRKey
protected void checkTRKey(PreflightContext context, COSDictionary egs)
Check the TR entry. A valid ExtGState hasn't TR entry.- Parameters:
context- the preflight contextegs- the graphic state to check
-
checkTR2Key
protected void checkTR2Key(PreflightContext context, COSDictionary egs)
Check the TR2 entry. A valid ExtGState hasn't TR2 entry or a TR2 entry equals to "default".- Parameters:
context- the preflight contextegs- the graphic state to check
-
-