Documentation ¶
Overview ¶
Package xmputil provides abstraction used by the pdf document XMP Metadata.
Index ¶
- type Document
- func (_gf *Document) GetGoXmpDocument() *_c.Document
- func (_egc *Document) GetMediaManagement() (*MediaManagement, bool)
- func (_edf *Document) GetPdfAID() (*PdfAID, bool)
- func (_gbea *Document) GetPdfInfo() (*PdfInfo, bool)
- func (_ad *Document) GetPdfaExtensionSchemas() ([]_ec.Schema, error)
- func (_fad *Document) Marshal() ([]byte, error)
- func (_bg *Document) MarshalIndent(prefix, indent string) ([]byte, error)
- func (_cde *Document) SetMediaManagement(options *MediaManagementOptions) error
- func (_ef *Document) SetPdfAExtension() error
- func (_gca *Document) SetPdfAID(part int, conformance string) error
- func (_aa *Document) SetPdfInfo(options *PdfInfoOptions) error
- type GUID
- type MediaManagement
- type MediaManagementDerivedFrom
- type MediaManagementOptions
- type MediaManagementVersion
- type PdfAID
- type PdfInfo
- type PdfInfoOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an implementation of the xmp document. It is a wrapper over go-xmp/xmp.Document that provides some Pdf predefined functionality.
func LoadDocument ¶
LoadDocument loads up the xmp document from provided input stream.
func NewDocument ¶
func NewDocument() *Document
NewDocument creates a new document without any previous xmp information.
func (*Document) GetGoXmpDocument ¶
GetGoXmpDocument gets direct access to the go-xmp.Document. All changes done to specified document would result in change of this document 'd'.
func (*Document) GetMediaManagement ¶
func (_egc *Document) GetMediaManagement() (*MediaManagement, bool)
GetMediaManagement gets the media management metadata from provided xmp document.
func (*Document) GetPdfInfo ¶
GetPdfInfo gets the document pdf info.
func (*Document) GetPdfaExtensionSchemas ¶
GetPdfaExtensionSchemas gets a pdfa extension schemas.
func (*Document) MarshalIndent ¶
MarshalIndent the document into xml byte stream with predefined prefix and indent.
func (*Document) SetMediaManagement ¶
func (_cde *Document) SetMediaManagement(options *MediaManagementOptions) error
SetMediaManagement sets up XMP media management metadata: namespace xmpMM.
func (*Document) SetPdfAExtension ¶
SetPdfAExtension sets the pdfaExtension XMP metadata.
func (*Document) SetPdfAID ¶
SetPdfAID sets up pdfaid xmp metadata. In example: Part: '1' Conformance: 'B' states for PDF/A 1B.
func (*Document) SetPdfInfo ¶
func (_aa *Document) SetPdfInfo(options *PdfInfoOptions) error
SetPdfInfo sets the pdf info into selected document.
type MediaManagement ¶
type MediaManagement struct { // OriginalDocumentID as media is imported and projects is started, an original-document ID // must be created to identify a new document. This identifies a document as a conceptual entity. OriginalDocumentID GUID // DocumentID when a document is copied to a new file path or converted to a new format with // Save As, another new document ID should usually be assigned. This identifies a general version or // branch of a document. You can use it to track different versions or extracted portions of a document // with the same original-document ID. DocumentID GUID // InstanceID to track a document’s editing history, you must assign a new instance ID // whenever a document is saved after any changes. This uniquely identifies an exact version of a // document. It is used in resource references (to identify both the document or part itself and the // referenced or referencing documents), and in document-history resource events (to identify the // document instance that resulted from the change). InstanceID GUID // DerivedFrom references the source document from which this one is derived, // typically through a Save As operation that changes the file name or format. It is a minimal reference; // missing components can be assumed to be unchanged. For example, a new version might only need // to specify the instance ID and version number of the previous version, or a rendition might only need // to specify the instance ID and rendition class of the original. DerivedFrom *MediaManagementDerivedFrom // VersionID are meant to associate the document with a product version that is part of a release process. They can be useful in tracking the // document history, but should not be used to identify a document uniquely in any context. // Usually it simply works by incrementing integers 1,2,3... VersionID string // Versions is the history of the document versions along with the comments, timestamps and issuers. Versions []MediaManagementVersion }
MediaManagement are the values from the document media management metadata.
type MediaManagementDerivedFrom ¶
type MediaManagementDerivedFrom struct { OriginalDocumentID GUID DocumentID GUID InstanceID GUID VersionID string }
MediaManagementDerivedFrom is a structure that contains references of identifiers and versions from which given document was derived.
type MediaManagementOptions ¶
type MediaManagementOptions struct { // OriginalDocumentID as media is imported and projects is started, an original-document ID // must be created to identify a new document. This identifies a document as a conceptual entity. // By default, this value is generated. OriginalDocumentID string // NewDocumentID is a flag which generates a new Document identifier while setting media management. // This value should be set to true only if the document is stored and saved as new document. // Otherwise, if the document is modified and overwrites previous file, it should be set to false. NewDocumentID bool // DocumentID when a document is copied to a new file path or converted to a new format with // Save As, another new document ID should usually be assigned. This identifies a general version or // branch of a document. You can use it to track different versions or extracted portions of a document // with the same original-document ID. // By default, this value is generated if NewDocumentID is true or previous doesn't exist. DocumentID string // InstanceID to track a document’s editing history, you must assign a new instance ID // whenever a document is saved after any changes. This uniquely identifies an exact version of a // document. It is used in resource references (to identify both the document or part itself and the // referenced or referencing documents), and in document-history resource events (to identify the // document instance that resulted from the change). // By default, this value is generated. InstanceID string // DerivedFrom references the source document from which this one is derived, // typically through a Save As operation that changes the file name or format. It is a minimal reference; // missing components can be assumed to be unchanged. For example, a new version might only need // to specify the instance ID and version number of the previous version, or a rendition might only need // to specify the instance ID and rendition class of the original. // By default, the derived from structure is filled from previous XMP metadata (if exists). DerivedFrom string // VersionID are meant to associate the document with a product version that is part of a release process. They can be useful in tracking the // document history, but should not be used to identify a document uniquely in any context. // Usually it simply works by incrementing integers 1,2,3... // By default, this values is incremented or set to the next version number. VersionID string // ModifyComment is a comment to given modification ModifyComment string // ModifyDate is a custom modification date for the versions. // By default, this would be set to time.Now(). ModifyDate _b.Time // Modifier is a person who did the modification. Modifier string }
MediaManagementOptions are the options for the Media management xmp metadata.
type MediaManagementVersion ¶
type MediaManagementVersion struct { VersionID string ModifyDate _b.Time Comments string Modifier string }
MediaManagementVersion is the version of the media management xmp metadata.
type PdfInfoOptions ¶
type PdfInfoOptions struct { InfoDict _dd.PdfObject PdfVersion string Copyright string Marked bool // Overwrite if set to true, overwrites all values found in the current pdf info xmp model to the ones provided. Overwrite bool }
PdfInfoOptions are the options used for setting pdf info.