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.

profiles.go
// 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.Structure6.1.x — file header, trailer, xref, object framing, limits
Checks.Colour6.2.2 OutputIntent, 6.2.3.x device colours, 6.2.9–10
Checks.Image6.2.4-6.2.7 image/form/PostScript XObjects
Checks.Transparency6.2.8 transfer functions, 6.4 soft masks/blend modes/alpha
Checks.Font6.3.x embedding, subsets, metrics, encoding
Checks.Annotation6.5.x annotation types and dictionaries
Checks.Action6.6.x action types and additional actions
Checks.Metadata6.7.x XMP metadata, extension schemas, PDF/A identifier
Checks.LogicalStructure6.8 tagged PDF structure hierarchy and marked content
Checks.Form6.9 interactive forms
Checks.ObjectModelGeneric 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.

lookup.go
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 name

Legacy 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.

legacy.go
// 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.

objectmodel.go
// "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()