func Validate(d *model.CompliancePdfReader, profile Profile) error
Validate checks if provided input document reader matches given PDF/A profile.
Profile is the model.StandardImplementer enhanced by the information about the profile conformance level.
type Profile interface { model.StandardImplementer Conformance() string Part() int }
Profile1A is the implementation of the PDF/A-1A standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile1A struct {
// contains filtered or unexported fields
}
func NewProfile1A(options *Profile1Options) *Profile1A
NewProfile1A creates a new Profile1A with given options.
func (p *Profile1A) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-1 standard. Implements model.StandardApplier.
func (p *Profile1A) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile1A) Part() int
Part gets the PDF/A version level.
func (p *Profile1A) StandardName() string
StandardName gets the name of the standard.
func (p *Profile1A) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-1 standard.
Profile1B is the implementation of the PDF/A-1B standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile1B struct {
// contains filtered or unexported fields
}
func NewProfile1B(options *Profile1Options) *Profile1B
NewProfile1B creates a new Profile1B with the given options.
func (p *Profile1B) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-1 standard. Implements model.StandardApplier.
func (p *Profile1B) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile1B) Part() int
Part gets the PDF/A version level.
func (p *Profile1B) StandardName() string
StandardName gets the name of the standard.
func (p *Profile1B) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-1 standard.
Profile1Options are the options that changes the way how optimizer may try to adapt document into PDF/A standard.
type Profile1Options struct { // CMYKDefaultColorSpace is an option that refers PDF/A-1 CMYKDefaultColorSpace bool // Now is a function that returns current time. Now func() time.Time // UUIDGenerator is the generator function of the document UUID. UUIDGenerator UUIDGenerator }
func DefaultProfile1Options() *Profile1Options
DefaultProfile1Options are the default options for the Profile1.
UUID is the unique universe identifier. It is used to generate XMP document uuid identifier.
type UUID [16]byte
func NewUUID() UUID
NewUUID is the UUIDGenerator function used for determining new UUID value.
UUIDGenerator is the generator for the UUID.
type UUIDGenerator func() UUID
VerificationError is the PDF/A verification error structure, that contains all violated rules.
type VerificationError struct { // ViolatedRules are the rules that were violated during error verification. ViolatedRules []ViolatedRule // ConformanceLevel defines the standard on verification failed. ConformanceLevel int // ConformanceVariant is the standard variant used on verification. ConformanceVariant string }
func (v VerificationError) Error() string
Error implements error interface.
ViolatedRule is the structure that defines violated PDF/A rule.
type ViolatedRule struct { RuleNo string Detail string }
func (v ViolatedRule) String() string
String gets a string representation of the violated rule.