HomeUniDoc
...

Package xmp

Overview ▾

Package xmp provides abstraction used by the pdf document XMP Metadata.

type Bool

Bool is the wrapper over boolean used in the Metadata.

type Bool bool
const (
    // True is the Bool wrapper for standard boolean = true.
    True Bool = true
    // False is the Bool wrapper for the standard boolean = false.
    False Bool = false
)

func (Bool) MarshalText

func (x Bool) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler interface.

func (*Bool) UnmarshalText

func (x *Bool) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler interface.

func (Bool) Value

func (x Bool) Value() bool

Value gets the boolean value.

type Metadata

Metadata is the xmp defined metadata structure, that is used to extract or inject XMP based document metadata. NOTE: This implementation is in experimental development state.

Keep in mind that it might change in the subsequent minor versions.
type Metadata struct {
    DocumentID    uuid.UUID
    UniPDFVersion string
    Title         string
    Author        []string
    Subject       string
    Keywords      string
    Creator       string
    Producer      string
    PDFVersion    string
    CreationDate  Time
    ModifyDate    Time
    MetadataDate  Time
    Trapped       Bool
    Copyright     string
    Marked        Bool
    PdfA          *PdfA
}

func NewMetadataFromPdfInfo

func NewMetadataFromPdfInfo(obj core.PdfObject) (Metadata, error)

NewMetadataFromPdfInfo creates a new Metadata structure form the input model.PdfInfo.

func (*Metadata) MarshalXMP

func (m *Metadata) MarshalXMP() ([]byte, error)

MarshalXMP marshals given metadata into byte stream.

type PdfA

PdfA is the conformance level for the PDF/A module.

type PdfA struct {
    Part        int
    Conformance string
}

type Time

Time is the time.Time wrapper that is used for special parsing the time fields.

type Time time.Time

func Now

func Now() Time

Now gets the current Time.

func WrapTime

func WrapTime(t time.Time) Time

WrapTime creates a new metadata date.

func (Time) IsZero

func (x Time) IsZero() bool

IsZero checks if given time has zero value.

func (Time) MarshalText

func (x Time) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler interface.

func (Time) String

func (x Time) String() string