metadata

package
v0.0.0-...-de6dcb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OfficeVersions = map[string]string{
	"16": "2016",
	"15": "2013",
	"14": "2010",
	"12": "2007",
	"11": "2003",
}

Functions

func ParseFileTrailer

func ParseFileTrailer(buf []byte, current int) (nextOffset int, xref *XRef, trailer *Trailer, err error)

Types

type Info

type Info struct {
	XMLName  xml.Name `xml:"xmpmeta"`
	Author   string   `xml:"RDF>Description>creator"`
	Creator  string   `xml:"RDF>Description>CreatorTool"`
	Producer string   `xml:"RDF>Description>Producer"`
}

func NewPropertiesFromPDFDoc

func NewPropertiesFromPDFDoc(file string) (info []Info, err error)

type Meta

type Meta struct {
}

type OfficeAppProperty

type OfficeAppProperty struct {
	XMLName     xml.Name `xml:"Properties"`
	Application string   `xml:"Application"`
	Company     string   `xml:"Company"`
	Version     string   `xml:"AppVersion"`
}

func (*OfficeAppProperty) GetMajorVersion

func (a *OfficeAppProperty) GetMajorVersion() string

type OfficeCoreProperty

type OfficeCoreProperty struct {
	XMLName        xml.Name `xml:"coreProperties"`
	Creator        string   `xml:"creator"`
	LastModifiedBy string   `xml:"lastModifiedBy"`
}

type PDFBytes

type PDFBytes []byte

func NewPDFData

func NewPDFData(buf []byte, stripNewLines bool) PDFBytes

func (PDFBytes) GetMetaRef

func (b PDFBytes) GetMetaRef() (ref *Reference, err error)

func (PDFBytes) ToInfo

func (b PDFBytes) ToInfo(xref XRef, doc []byte) (*Info, error)

func (PDFBytes) ToString

func (b PDFBytes) ToString() string

func (PDFBytes) ToTrailer

func (b PDFBytes) ToTrailer() (*Trailer, error)

func (PDFBytes) ToXMLStream

func (b PDFBytes) ToXMLStream() []byte

func (PDFBytes) ToXRef

func (b PDFBytes) ToXRef() (*XRef, error)

func (PDFBytes) TypeOf

func (b PDFBytes) TypeOf() string

type Reference

type Reference struct {
	ObjectID int
	GenID    int
}

type Trailer

type Trailer struct {
	Root *Reference
	Info *Reference
	Prev int
}

type XRef

type XRef struct {
	StartID   int
	Count     int
	ObjectRef []XRefObject
}

func (XRef) FetchData

func (x XRef) FetchData(buf []byte, ref Reference) PDFBytes

type XRefObject

type XRefObject struct {
	ObjectID int
	Offset   int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL