/** * Extracts and compares first and last trailers for PDF version between 1.1 and 1.4. * * @param ctx the preflight context. */ protected void checkTrailersForLinearizedPDF14(PreflightContext ctx) { COSDictionary first = ctx.getXrefTrailerResolver().getFirstTrailer(); if (first == null) { addValidationError(ctx, new ValidationError(ERROR_SYNTAX_TRAILER, "There are no trailer in the PDF file")); } else { COSDictionary last = ctx.getXrefTrailerResolver().getLastTrailer(); COSDocument cosDoc = new COSDocument(); checkMainTrailer(ctx, first); if (!compareIds(first, last, cosDoc)) { addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER_ID_CONSISTENCY, "ID is different in the first and the last trailer")); } COSUtils.closeDocumentQuietly(cosDoc); } }
/** * Extracts and compares first and last trailers for PDF version between 1.1 and 1.4. * * @param ctx the preflight context. */ protected void checkTrailersForLinearizedPDF14(PreflightContext ctx) { COSDictionary first = ctx.getXrefTrailerResolver().getFirstTrailer(); if (first == null) { addValidationError(ctx, new ValidationError(ERROR_SYNTAX_TRAILER, "There are no trailer in the PDF file")); } else { COSDictionary last = ctx.getXrefTrailerResolver().getLastTrailer(); COSDocument cosDoc = new COSDocument(); checkMainTrailer(ctx, first); if (!compareIds(first, last, cosDoc)) { addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER_ID_CONSISTENCY, "ID is different in the first and the last trailer")); } COSUtils.closeDocumentQuietly(cosDoc); } }
/** * Extracts and compares first and last trailers for PDF version between 1.1 and 1.4. * * @param ctx the preflight context. */ protected void checkTrailersForLinearizedPDF14(PreflightContext ctx) { COSDictionary first = ctx.getXrefTrailerResolver().getFirstTrailer(); if (first == null) { addValidationError(ctx, new ValidationError(ERROR_SYNTAX_TRAILER, "There are no trailer in the PDF file")); } else { COSDictionary last = ctx.getXrefTrailerResolver().getLastTrailer(); COSDocument cosDoc = new COSDocument(); checkMainTrailer(ctx, first); if (!compareIds(first, last, cosDoc)) { addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER_ID_CONSISTENCY, "ID is different in the first and the last trailer")); } COSUtils.closeDocumentQuietly(cosDoc); } }