Documentation
¶
Overview ¶
Package pdfa provides abstraction to optimize and verify documents with respect to the PDF/A standards. NOTE: This implementation is in experimental development state.
Keep in mind that it might change in the subsequent minor versions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Profile ¶
type Profile interface {
_f.StandardImplementer
Conformance() string
Part() int
}
Profile is the model.StandardImplementer enhanced by the information about the profile conformance level.
type Profile1A ¶
type Profile1A struct {
// contains filtered or unexported fields
}
Profile1A is the implementation of the PDF/A-1A standard profile. Implements model.StandardImplementer, Profile interfaces.
func NewProfile1A ¶
func NewProfile1A(options *Profile1Options) *Profile1A
NewProfile1A creates a new Profile1A with given options.
func (*Profile1A) ApplyStandard ¶
ApplyStandard tries to change the content of the writer to match the PDF/A-1 standard. Implements model.StandardApplier.
func (*Profile1A) Conformance ¶
func (_fegb *Profile1A) Conformance() string
Conformance gets the PDF/A conformance.
func (*Profile1A) StandardName ¶
func (_eabe *Profile1A) StandardName() string
StandardName gets the name of the standard.
func (*Profile1A) ValidateStandard ¶
func (_adef *Profile1A) ValidateStandard(r *_f.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-1 standard.
type Profile1B ¶
type Profile1B struct {
// contains filtered or unexported fields
}
Profile1B is the implementation of the PDF/A-1B standard profile. Implements model.StandardImplementer, Profile interfaces.
func NewProfile1B ¶
func NewProfile1B(options *Profile1Options) *Profile1B
NewProfile1B creates a new Profile1B with the given options.
func (*Profile1B) ApplyStandard ¶
ApplyStandard tries to change the content of the writer to match the PDF/A-1 standard. Implements model.StandardApplier.
func (*Profile1B) Conformance ¶
func (_fegb *Profile1B) Conformance() string
Conformance gets the PDF/A conformance.
func (*Profile1B) StandardName ¶
func (_eabe *Profile1B) StandardName() string
StandardName gets the name of the standard.
func (*Profile1B) ValidateStandard ¶
func (_adef *Profile1B) ValidateStandard(r *_f.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-1 standard.
type Profile1Options ¶
type Profile1Options struct {
// CMYKDefaultColorSpace is an option that refers PDF/A-1
CMYKDefaultColorSpace bool
// Now is a function that returns current time.
Now func() _e.Time
// Xmp is the xmp options information.
Xmp XmpOptions
}
Profile1Options are the options that changes the way how optimizer may try to adapt document into PDF/A standard.
func DefaultProfile1Options ¶
func DefaultProfile1Options() *Profile1Options
DefaultProfile1Options are the default options for the Profile1.
type Profile2A ¶
type Profile2A struct {
// contains filtered or unexported fields
}
Profile2A is the implementation of the PDF/A-2A standard profile. Implements model.StandardImplementer, Profile interfaces.
func NewProfile2A ¶
func NewProfile2A(options *Profile2Options) *Profile2A
NewProfile2A creates a new Profile2A with given options.
func (*Profile2A) ApplyStandard ¶
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (*Profile2A) Conformance ¶
func (_befa *Profile2A) Conformance() string
Conformance gets the PDF/A conformance.
func (*Profile2A) StandardName ¶
func (_fcg *Profile2A) StandardName() string
StandardName gets the name of the standard.
func (*Profile2A) ValidateStandard ¶
func (_gabb *Profile2A) ValidateStandard(r *_f.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
type Profile2B ¶
type Profile2B struct {
// contains filtered or unexported fields
}
Profile2B is the implementation of the PDF/A-2B standard profile. Implements model.StandardImplementer, Profile interfaces.
func NewProfile2B ¶
func NewProfile2B(options *Profile2Options) *Profile2B
NewProfile2B creates a new Profile2B with the given options.
func (*Profile2B) ApplyStandard ¶
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (*Profile2B) Conformance ¶
func (_befa *Profile2B) Conformance() string
Conformance gets the PDF/A conformance.
func (*Profile2B) StandardName ¶
func (_fcg *Profile2B) StandardName() string
StandardName gets the name of the standard.
func (*Profile2B) ValidateStandard ¶
func (_gabb *Profile2B) ValidateStandard(r *_f.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
type Profile2Options ¶
type Profile2Options struct {
// CMYKDefaultColorSpace is an option that refers PDF/A
CMYKDefaultColorSpace bool
// Now is a function that returns current time.
Now func() _e.Time
// Xmp is the xmp options information.
Xmp XmpOptions
}
Profile2Options are the options that changes the way how optimizer may try to adapt document into PDF/A standard.
func DefaultProfile2Options ¶
func DefaultProfile2Options() *Profile2Options
DefaultProfile2Options are the default options for the Profile2.
type Profile2U ¶
type Profile2U struct {
// contains filtered or unexported fields
}
Profile2U is the implementation of the PDF/A-2U standard profile. Implements model.StandardImplementer, Profile interfaces.
func NewProfile2U ¶
func NewProfile2U(options *Profile2Options) *Profile2U
NewProfile2U creates a new Profile2U with the given options.
func (*Profile2U) ApplyStandard ¶
ApplyStandard tries to change the content of the writer to match the PDF/A-2 standard. Implements model.StandardApplier.
func (*Profile2U) Conformance ¶
func (_befa *Profile2U) Conformance() string
Conformance gets the PDF/A conformance.
func (*Profile2U) StandardName ¶
func (_fcg *Profile2U) StandardName() string
StandardName gets the name of the standard.
func (*Profile2U) ValidateStandard ¶
func (_gabb *Profile2U) ValidateStandard(r *_f.CompliancePdfReader) error
ValidateStandard checks if provided input CompliancePdfReader matches rules that conforms PDF/A-2 standard.
type VerificationError ¶
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
}
VerificationError is the PDF/A verification error structure, that contains all violated rules.
func (VerificationError) Error ¶
func (_ce VerificationError) Error() string
Error implements error interface.
type ViolatedRule ¶
ViolatedRule is the structure that defines violated PDF/A rule.
func (ViolatedRule) String ¶
func (_ad ViolatedRule) String() string
String gets a string representation of the violated rule.
type XmpOptions ¶
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
}
XmpOptions are the options used by the optimization of the XMP metadata.