PDF/R-1 Conformance Validation
PDF/R-1 (ISO 23504-1:2020) is the raster-image subset of ISO 32000 used to store, transport and exchange scanned documents. A conforming file holds one or more image strips per page and little else: a single content stream places each strip with Do, every page writes its own media box, and the catalogue and information dictionary stay inside a fixed set of entries
THotPDF.ValidatePDFR1 reads a loaded document or the document being built and reports every departure as a structured diagnostic. Validation is non-mutating and never writes the document
Container rules
- Each page carries a direct
MediaBoxof the form[0 0 w h], and page tree nodes may not inherit one Resourcessits on the page and itsXObjectdictionary holds onlystrip0,strip1and so on, numbered contiguously from zero- The
Contentsentry is a single stream that may only issueq,Q,cmandDo, and everyDonames a strip - Strips appear in the file in page order, so their object numbers ascend
- Annotations, when present, are signature widgets with a zero-area rectangle
Strip encoding
Bit depth, colour space and compression are checked together, because PDF/R-1 ties them to each other
- Bitonal strips use
DeviceGrayorCalGrayat one bit per component, withCCITTFaxDecoderequiringKequal to-1,BlackIs1absent or false, andDecodeabsent or[0.0 1.0] - Grayscale strips use
CalGraywith aGammaof 2.2 at 8 or 16 bits, and only the 8-bit form may useDCTDecode - RGB strips use
ICCBasedorCalRGBat 8 or 16 bits, and anAlternateentry must beDeviceRGB - All strips of a page share one width, colour space, bit depth and
Intentstate
Document rules
- The catalogue only adds
Version,ViewerPreferences,PageLayout,PageMode,AcroFormandMetadatato its required entries - The information dictionary only holds
Creator,Producer,CreationDateandModDate, and an XMP stream that is present must carry the matching properties - Every indirect reference uses generation number zero, object streams are absent, and an unencrypted file declares a PDF 1.4 to 1.7 header
- Only
FlateDecode,CCITTFaxDecode,DCTDecodeandCryptmay appear as stream filters
Documented limits
Two parts of the standard sit outside the readable object graph and are therefore reported rather than claimed as verified
- The
%PDF-raster-1.0comment that marks a file as PDF/R lives in the raw byte image, which this validator does not receive - An encrypted file is accepted with a warning, because verifying it needs the standard security handler parameters rather than the document graph
Bounded execution
Object visits, retained issues, decoded bytes and content tokens are all capped by THPDFPDFR1ValidationOptions, and reaching a cap emits a stable limit diagnostic instead of growing without bound
Structured diagnostics
ValidatePDFR1 returns THPDFPDFR1ValidationIssues, an array of THPDFPDFR1ValidationIssue records whose THPDFPDFR1IssueSeverity identifies warnings and errors
Each issue carries a stable code, the ISO 23504-1 clause, an object path, an object number, a zero-based page index and a message
The THPDFComplianceFindings overload maps the same pass to the shared PDF/R-1 finding profile, so one report can mix profiles and serialise to JSON