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
// Xmp is the xmp options information.
Xmp XmpOptions
}
func DefaultProfile1Options() *Profile1Options
DefaultProfile1Options are the default options for the Profile1.
Profile2A is the implementation of the PDF/A-2A standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile2A struct {
// contains filtered or unexported fields
}
func NewProfile2A(options *Profile2Options) *Profile2A
NewProfile2A creates a new Profile2A with given options.
func (p *Profile2A) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (p *Profile2A) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile2A) Part() int
Part gets the PDF/A version level.
func (p *Profile2A) StandardName() string
StandardName gets the name of the standard.
func (p *Profile2A) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
Profile2B is the implementation of the PDF/A-2B standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile2B struct {
// contains filtered or unexported fields
}
func NewProfile2B(options *Profile2Options) *Profile2B
NewProfile2B creates a new Profile2B with the given options.
func (p *Profile2B) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (p *Profile2B) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile2B) Part() int
Part gets the PDF/A version level.
func (p *Profile2B) StandardName() string
StandardName gets the name of the standard.
func (p *Profile2B) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
Profile2Options are the options that changes the way how optimizer may try to adapt document into PDF/A standard.
type Profile2Options struct {
// CMYKDefaultColorSpace is an option that refers PDF/A
CMYKDefaultColorSpace bool
// Now is a function that returns current time.
Now func() time.Time
// Xmp is the xmp options information.
Xmp XmpOptions
}
func DefaultProfile2Options() *Profile2Options
DefaultProfile2Options are the default options for the Profile2.
Profile2U is the implementation of the PDF/A-2U standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile2U struct {
// contains filtered or unexported fields
}
func NewProfile2U(options *Profile2Options) *Profile2U
NewProfile2U creates a new Profile2U with the given options.
func (p *Profile2U) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (p *Profile2U) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile2U) Part() int
Part gets the PDF/A version level.
func (p *Profile2U) StandardName() string
StandardName gets the name of the standard.
func (p *Profile2U) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
Profile3A is the implementation of the PDF/A-3A standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile3A struct {
// contains filtered or unexported fields
}
func NewProfile3A(options *Profile3Options) *Profile3A
NewProfile3A creates a new Profile3A with given options.
func (p *Profile3A) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-3 standard. Implements model.StandardApplier.
func (p *Profile3A) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile3A) Part() int
Part gets the PDF/A version level.
func (p *Profile3A) StandardName() string
StandardName gets the name of the standard.
func (p *Profile3A) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-3 standard.
Profile3B is the implementation of the PDF/A-3B standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile3B struct {
// contains filtered or unexported fields
}
func NewProfile3B(options *Profile3Options) *Profile3B
NewProfile3B creates a new Profile3B with the given options.
func (p *Profile3B) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-3 standard. Implements model.StandardApplier.
func (p *Profile3B) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile3B) Part() int
Part gets the PDF/A version level.
func (p *Profile3B) StandardName() string
StandardName gets the name of the standard.
func (p *Profile3B) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-3 standard.
Profile3Options are the options that changes the way how optimizer may try to adapt document into PDF/A standard.
type Profile3Options struct {
// CMYKDefaultColorSpace is an option that refers PDF/A
CMYKDefaultColorSpace bool
// Now is a function that returns current time.
Now func() time.Time
// Xmp is the xmp options information.
Xmp XmpOptions
}
func DefaultProfile3Options() *Profile3Options
DefaultProfile3Options the default options for the Profile3.
Profile3U is the implementation of the PDF/A-3U standard profile. Implements model.StandardImplementer, Profile interfaces.
type Profile3U struct {
// contains filtered or unexported fields
}
func NewProfile3U(options *Profile3Options) *Profile3U
NewProfile3U creates a new Profile3U with the given options.
func (p *Profile3U) ApplyStandard(document *docutil.Document) (err error)
ApplyStandard tries to change the content of the writer to match the PDF/A-3 standard. Implements model.StandardApplier.
func (p *Profile3U) Conformance() string
Conformance gets the PDF/A conformance.
func (p *Profile3U) Part() int
Part gets the PDF/A version level.
func (p *Profile3U) StandardName() string
StandardName gets the name of the standard.
func (p *Profile3U) ValidateStandard(r *model.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-3 standard.
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.
XmpOptions are the options used by the optimization of the XMP metadata.
type XmpOptions struct {
// Copyright information.
Copyright string
// OriginalDocumentID is the original document identifier.
// By default, if this field is empty the value is extracted from the XMP Metadata or generated UUID.
OriginalDocumentID string
// DocumentID is the original document identifier.
// By default, if this field is empty the value is extracted from the XMP Metadata or generated UUID.
DocumentID string
// InstanceID is the original document identifier.
// By default, if this field is empty the value is set to generated UUID.
InstanceID string
// NewDocumentVersion is a flag that defines if a document was overwritten.
// If the new document was created this should be true. On changing given document file, and overwriting it it should be true.
NewDocumentVersion bool
// MarshalIndent defines marshaling indent of the XMP metadata.
MarshalIndent string
// MarshalPrefix defines marshaling prefix of the XMP metadata.
MarshalPrefix string
}