Search in sources :

Example 1 with PreflightContentStream

use of org.apache.pdfbox.preflight.content.PreflightContentStream in project pdfbox by apache.

the class TilingPatternValidationProcess method parsePatternContent.

/**
 * Validate the Pattern content like Color and Show Text Operators using an instance of ContentStreamWrapper.
 */
protected void parsePatternContent(PreflightContext context, PDPage page, PDTilingPattern pattern) throws ValidationException {
    PreflightContentStream csWrapper = new PreflightContentStream(context, page);
    csWrapper.validatePatternContentStream(pattern);
}
Also used : PreflightContentStream(org.apache.pdfbox.preflight.content.PreflightContentStream)

Example 2 with PreflightContentStream

use of org.apache.pdfbox.preflight.content.PreflightContentStream in project pdfbox by apache.

the class SinglePageValidationProcess method validateContent.

/**
 * @param context the preflight context.
 * @param page the page to check.
 * @throws ValidationException
 */
protected void validateContent(PreflightContext context, PDPage page) throws ValidationException {
    // TODO add this wrapper in the config object ?
    try {
        PreflightContentStream csWrapper = new PreflightContentStream(context, page);
        csWrapper.validatePageContentStream();
    } catch (IOException e) {
        LOGGER.debug("Unable to read page contet stream", e);
        context.addValidationError(new ValidationError(ERROR_UNKOWN_ERROR, e.getMessage(), e));
    }
}
Also used : IOException(java.io.IOException) ValidationError(org.apache.pdfbox.preflight.ValidationResult.ValidationError) PreflightContentStream(org.apache.pdfbox.preflight.content.PreflightContentStream)

Example 3 with PreflightContentStream

use of org.apache.pdfbox.preflight.content.PreflightContentStream in project pdfbox by apache.

the class XObjFormValidator method validateXObjectContent.

/**
 * An Form XObject is a ContentStream. This method method uses an instance of ContentStreamWrapper to check the
 * Stream of this Form XObject.
 */
protected void validateXObjectContent() throws ValidationException {
    PreflightPath vPath = context.getValidationPath();
    PreflightContentStream csWrapper = new PreflightContentStream(context, vPath.getClosestPathElement(PDPage.class));
    csWrapper.validateXObjContentStream(pdXObj);
}
Also used : PDPage(org.apache.pdfbox.pdmodel.PDPage) PreflightContentStream(org.apache.pdfbox.preflight.content.PreflightContentStream) PreflightPath(org.apache.pdfbox.preflight.PreflightPath)

Aggregations

PreflightContentStream (org.apache.pdfbox.preflight.content.PreflightContentStream)3 IOException (java.io.IOException)1 PDPage (org.apache.pdfbox.pdmodel.PDPage)1 PreflightPath (org.apache.pdfbox.preflight.PreflightPath)1 ValidationError (org.apache.pdfbox.preflight.ValidationResult.ValidationError)1