Profile is the model.StandardImplementer enhanced by PDF/UA part information.
type Profile interface {
model.StandardImplementer
Part() int
}
Profile1 is the implementation of the PDF/UA-1 (ISO 14289-1) standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile1 struct {
// contains filtered or unexported fields
}
func NewProfile1(options *Profile1Options) *Profile1
NewProfile1 creates a new Profile1 with given options.
func (p *Profile1) ApplyStandard(document *docutil.Document) error
ApplyStandard applies the mechanical subset of PDF/UA-1 requirements to the document. It cannot synthesize semantics: if the document is not a tagged PDF (no StructTreeRoot), an error is returned.
func (p *Profile1) Part() int
Part gets the PDF/UA part.
func (p *Profile1) StandardName() string
StandardName gets the name of the standard.
func (p *Profile1) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if the input CompliancePdfReader matches the PDF/UA-1 standard.
Known limitations (may yield false negatives): font checks (embedding/ToUnicode, 7.21.4.1-1, 7.21.7-1) inspect page resources only, so a font used solely inside a Form XObject is not seen (content tagging, 7.1-3, does descend into Form XObjects); ParentTree/MCID cross-reference validity is not verified. See the scope comment at the top of verifiers.go for the full list of deferred rules.
Profile1Options are the options for the PDF/UA-1 profile.
type Profile1Options struct {
// DefaultLanguage is set as the catalog Lang entry by ApplyStandard when
// the document defines none. Ignored when empty.
DefaultLanguage string
// Xmp is the xmp options information.
Xmp XmpOptions
}
func DefaultProfile1Options() *Profile1Options
DefaultProfile1Options are the default options for the Profile1.
Profile2 implements the PDF/UA-2 (ISO 14289-2) standard profile.
type Profile2 struct {
// contains filtered or unexported fields
}
func NewProfile2(options *Profile2Options) *Profile2
NewProfile2 creates a new Profile2 with the given options.
func (p *Profile2) ApplyStandard(document *docutil.Document) error
ApplyStandard applies the mechanical subset of PDF/UA-2 requirements.
func (p *Profile2) Part() int
Part gets the PDF/UA part.
func (p *Profile2) StandardName() string
StandardName gets the name of the standard.
func (p *Profile2) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if the input matches the PDF/UA-2 standard.
Profile2Options are the options for the PDF/UA-2 profile.
type Profile2Options struct {
// DefaultLanguage is set as the catalog Lang entry by ApplyStandard when
// the document defines none. Ignored when empty.
DefaultLanguage string
// Xmp is the xmp options information.
Xmp XmpOptions
}
func DefaultProfile2Options() *Profile2Options
DefaultProfile2Options are the default options for Profile2.
VerificationError is the PDF/UA verification error containing all violated rules.
type VerificationError struct {
// ViolatedRules are the rules that were violated during verification.
ViolatedRules []ViolatedRule
// Part defines the PDF/UA part (1 or 2) on which verification failed.
Part int
}
func (v VerificationError) Error() string
Error implements error interface.
ViolatedRule defines a violated PDF/UA rule. RuleNo follows the clause numbering of ISO 14289 (e.g. "7.1-3").
type ViolatedRule struct {
RuleNo string
Detail string
}
func (v ViolatedRule) String() string
String gets a string representation of the violated rule.
XmpOptions are the options used when writing the PDF/UA XMP metadata.
type XmpOptions struct {
// Copyright information.
Copyright string
// MarshalIndent defines marshaling indent of the XMP metadata.
MarshalIndent string
// MarshalPrefix defines marshaling prefix of the XMP metadata.
MarshalPrefix string
}