HomeUniDoc
HomeUniDoc
...

Package docutil

Overview ▾

Index ▾

type Catalog
    func (c *Catalog) GetMarkInfo() (*core.PdfObjectDictionary, bool)
    func (c *Catalog) GetMetadata() (*core.PdfObjectStream, bool)
    func (c *Catalog) GetOutputIntents() (*OutputIntents, bool)
    func (c *Catalog) GetPages() ([]Page, bool)
    func (c *Catalog) HasMetadata() bool
    func (c *Catalog) NewOutputIntents() *OutputIntents
    func (c *Catalog) SetMarkInfo(mi core.PdfObject)
    func (c *Catalog) SetMetadata(data []byte) error
    func (c *Catalog) SetOutputIntents(outputIntents *OutputIntents)
    func (c *Catalog) SetVersion()
type Content
    func (c Content) GetData() ([]byte, error)
    func (c *Content) SetData(data []byte) error
type Document
    func (d *Document) AddIndirectObject(indirect *core.PdfIndirectObject)
    func (d *Document) AddStream(stream *core.PdfObjectStream)
    func (d *Document) FindCatalog() (*Catalog, bool)
    func (d *Document) GetPages() ([]Page, bool)
type Image
type ImageSMask
type OutputIntent
type OutputIntents
    func (o *OutputIntents) Add(oi core.PdfObject) error
    func (o *OutputIntents) Get(i int) (OutputIntent, bool)
    func (o *OutputIntents) Len() int
type Page
    func (p Page) FindXObjectForms() []*core.PdfObjectStream
    func (p Page) FindXObjectImages() ([]*Image, error)
    func (p Page) GetContents() ([]Content, bool)
    func (p Page) GetResources() (*core.PdfObjectDictionary, bool)
    func (p Page) GetResourcesXObject() (*core.PdfObjectDictionary, bool)
    func (p *Page) Number() int

Package files

catalog.go document.go image.go page.go

type Catalog

Catalog is the type wrapper over raw core.PdfObjectDictionary that contains some object getter helpers.

type Catalog struct {
    Object *core.PdfObjectDictionary
    // contains filtered or unexported fields
}

func (*Catalog) GetMarkInfo

func (c *Catalog) GetMarkInfo() (*core.PdfObjectDictionary, bool)

GetMarkInfo gets the MarkInfo entry of the Catalog.

func (*Catalog) GetMetadata

func (c *Catalog) GetMetadata() (*core.PdfObjectStream, bool)

GetMetadata gets the metadata stream from the catalog.

func (*Catalog) GetOutputIntents

func (c *Catalog) GetOutputIntents() (*OutputIntents, bool)

GetOutputIntents gets the catalog output intents.

func (*Catalog) GetPages

func (c *Catalog) GetPages() ([]Page, bool)

GetPages gets catalog pages.

func (*Catalog) HasMetadata

func (c *Catalog) HasMetadata() bool

HasMetadata checks if given catalog already has a metadata.

func (*Catalog) NewOutputIntents

func (c *Catalog) NewOutputIntents() *OutputIntents

func (*Catalog) SetMarkInfo

func (c *Catalog) SetMarkInfo(mi core.PdfObject)

SetMarkInfo sets up the MarkInfo object for given catalog.

func (*Catalog) SetMetadata

func (c *Catalog) SetMetadata(data []byte) error

SetMetadata sets the catalog metadata object.

func (*Catalog) SetOutputIntents

func (c *Catalog) SetOutputIntents(outputIntents *OutputIntents)

SetOutputIntents creates a new output intents.

func (*Catalog) SetVersion

func (c *Catalog) SetVersion()

SetVersion sets the catalog dictionary version.

type Content

Content is a wrapper over page content.

type Content struct {
    Stream *core.PdfObjectStream
    // contains filtered or unexported fields
}

func (Content) GetData

func (c Content) GetData() ([]byte, error)

GetData gets the stream data from given content.

func (*Content) SetData

func (c *Content) SetData(data []byte) error

SetData sets up content stream data.

type Document

Document is a representation of the Pdf document.

type Document struct {
    ID             [2]string
    Version        core.Version
    Objects        []core.PdfObject
    Info           core.PdfObject
    Crypt          *core.PdfCrypt
    UseHashBasedID bool
}

func (*Document) AddIndirectObject

func (d *Document) AddIndirectObject(indirect *core.PdfIndirectObject)

AddIndirectObject adds an indirect object to the document.

func (*Document) AddStream

func (d *Document) AddStream(stream *core.PdfObjectStream)

AddStream adds the stream into given objects. Checks if given object doesn't exists already.

func (*Document) FindCatalog

func (d *Document) FindCatalog() (*Catalog, bool)

FindCatalog finds document catalog from the input objects.

func (*Document) GetPages

func (d *Document) GetPages() ([]Page, bool)

GetPages gets all document pages.

type Image

type Image struct {
    Name             string
    Width            int
    Height           int
    Colorspace       core.PdfObjectName
    ColorComponents  int
    BitsPerComponent int
    SMask            *ImageSMask
    Stream           *core.PdfObjectStream
}

type ImageSMask

type ImageSMask struct {
    Image  *Image
    Stream *core.PdfObjectStream
}

type OutputIntent

OutputIntent is the wrapper over object that is meant to be an object intent.

type OutputIntent struct {
    Object *core.PdfObjectDictionary
}

type OutputIntents

OutputIntents is the type wrapper over an object array that is meant to be a catalog OutputIntents.

type OutputIntents struct {
    // contains filtered or unexported fields
}

func (*OutputIntents) Add

func (o *OutputIntents) Add(oi core.PdfObject) error

Add new output intent into given output intents model.

func (*OutputIntents) Get

func (o *OutputIntents) Get(i int) (OutputIntent, bool)

Get the object intent at the i'th position.

func (*OutputIntents) Len

func (o *OutputIntents) Len() int

Len gets the length of the object intents array.

type Page

Page is a wrapper over the Page core.PdfObjectDictionary.

type Page struct {
    Object *core.PdfObjectDictionary
    // contains filtered or unexported fields
}

func (Page) FindXObjectForms

func (p Page) FindXObjectForms() []*core.PdfObjectStream

FindXObjectForms finds page XObject forms.

func (Page) FindXObjectImages

func (p Page) FindXObjectImages() ([]*Image, error)

FindXObjectImages finds XObject images for given page.

func (Page) GetContents

func (p Page) GetContents() ([]Content, bool)

GetContents gets all page contents.

func (Page) GetResources

func (p Page) GetResources() (*core.PdfObjectDictionary, bool)

GetResources gets page resources dictionary.

func (Page) GetResourcesXObject

func (p Page) GetResourcesXObject() (*core.PdfObjectDictionary, bool)

GetResourcesXObject gets the page resources XObject.

func (*Page) Number

func (p *Page) Number() int

Number gets the page number.