Profiles
Run only the checks you care about, pick the Isartor-literal reading of PDF/A-1b, or check plain ISO 32000 validity.
Built-in profiles: PDFA1B, PDFA2B, Legacy1B and PDF (object model only). Profiles are immutable: AddCheck, RemoveCheck and Clear return a clone, so a profile is safe to share across goroutines.
// Built-in profiles: PDFA1B, Legacy1B, PDFA2B and PDF (object model only).
// The same call verifies or converts against any of them.
v2, err := doc.Verify(gopdfrab.PDFA2B)
cr2, err := doc.Convert(gopdfrab.PDFA2B)
// Start from the full profile and remove checks
p := gopdfrab.PDFA1B.
RemoveCheck(gopdfrab.Checks.Structure.FileHeaderSignature).
RemoveCheck(gopdfrab.Checks.Font.SimpleNotEmbedded)
res, err := doc.Verify(p)
// Or start from an empty profile and add only what you need
p2 := gopdfrab.PDFA1B.Clear().
AddCheck(
gopdfrab.Checks.Transparency.ImageWithSoftMask,
gopdfrab.Checks.Metadata.PDFAIdentifierMissing,
)
res2, err := doc.Verify(p2)Checks are grouped by spec area in the Checks registry:
| Checks.Structure | 6.1.x — file header, trailer, xref, object framing, limits |
|---|---|
| Checks.Colour | 6.2.2 OutputIntent, 6.2.3.x device colours, 6.2.9–10 |
| Checks.Image | 6.2.4-6.2.7 image/form/PostScript XObjects |
| Checks.Transparency | 6.2.8 transfer functions, 6.4 soft masks/blend modes/alpha |
| Checks.Font | 6.3.x embedding, subsets, metrics, encoding |
| Checks.Annotation | 6.5.x annotation types and dictionaries |
| Checks.Action | 6.6.x action types and additional actions |
| Checks.Metadata | 6.7.x XMP metadata, extension schemas, PDF/A identifier |
| Checks.LogicalStructure | 6.8 tagged PDF structure hierarchy and marked content |
| Checks.Form | 6.9 interactive forms |
| Checks.ObjectModel | Generic ISO 32000 object-model conformance, independent of PDF/A |
Clause numbers are only unique within a conformance level, so look checks up with CheckByClauseIn and ChecksForClauseIn.
gopdfrab.AllChecks() // every registered check, with names, descriptions, clauses
gopdfrab.CheckByClauseIn(gopdfrab.A1B, "6.3.4", 1) // one check by level, clause and index
gopdfrab.ChecksForClauseIn(gopdfrab.A1B, "6.3.4") // all checks under a clause in a level
gopdfrab.ProfileByName("legacy1b") // a built-in profile by its CLI nameLegacy Isartor profile
PDFA1B follows veraPDF's reading where the spec is ambiguous. Legacy1B is the strict, spec-literal reading the Isartor suite expects. Pick whichever matches who judges your output. gopdfrab passes both suites in full.
// Verify against the legacy Isartor-derived profile instead of the
// veraPDF-aligned default
v, err := doc.Verify(gopdfrab.Legacy1B)Object model
Checks.ObjectModel holds 6 checks derived from the Arlington PDF Model. They answer "is this valid PDF?" independently of PDF/A. ConvertObjectModel repairs against those checks only.
// "Is this even valid PDF?" -- independent of any PDF/A conformance level
res, err := gopdfrab.VerifyObjectModel(path)
res, err = gopdfrab.VerifyObjectModelBytes(data)
res, err = doc.VerifyObjectModel()
// Equivalent to verifying with the object-model-only profile
res, err = doc.Verify(gopdfrab.ObjectModelOnly())
// Shorthand for VerifyObjectModel().Valid
ok, err := doc.IsPDF()
// Repairs against the object-model checks only, applying every fix that is
// safe and semantics-preserving and reporting anything else as a residual.
cr, err := gopdfrab.ConvertObjectModel(path)
defer cr.Close()
cr, err = gopdfrab.ConvertObjectModelBytes(data)
cr, err = doc.ConvertObjectModel()