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 (c *Catalog) GetMarkInfo() (*core.PdfObjectDictionary, bool)
GetMarkInfo gets the MarkInfo entry of the Catalog.
func (c *Catalog) GetMetadata() (*core.PdfObjectStream, bool)
GetMetadata gets the metadata stream from the catalog.
func (c *Catalog) GetOutputIntents() (*OutputIntents, bool)
GetOutputIntents gets the catalog output intents.
func (c *Catalog) GetPages() ([]Page, bool)
GetPages gets catalog pages.
func (c *Catalog) GetStructTreeRoot() (*core.PdfObjectDictionary, bool)
GetStructTreeRoot gets StructTreeRoot dictionary from the catalog.
func (c *Catalog) HasMetadata() bool
HasMetadata checks if given catalog already has a metadata.
func (c *Catalog) NewOutputIntents() *OutputIntents
func (c *Catalog) SetMarkInfo(mi core.PdfObject)
SetMarkInfo sets up the MarkInfo object for given catalog.
func (c *Catalog) SetMetadata(data []byte) error
SetMetadata sets the catalog metadata object.
func (c *Catalog) SetOutputIntents(outputIntents *OutputIntents)
SetOutputIntents creates a new output intents.
func (c *Catalog) SetStructTreeRoot(structTreeRoot core.PdfObject)
SetStructTreeRoot sets the catalog StructTreeRoot dictionary.
func (c *Catalog) SetVersion()
SetVersion sets the catalog dictionary version.
Content is a wrapper over page content.
type Content struct {
Stream *core.PdfObjectStream
// contains filtered or unexported fields
}
func (c Content) GetData() ([]byte, error)
GetData gets the stream data from given content.
func (c *Content) SetData(data []byte) error
SetData sets up content stream data.
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 (d *Document) AddIndirectObject(indirect *core.PdfIndirectObject)
AddIndirectObject adds an indirect object to the document.
func (d *Document) AddStream(stream *core.PdfObjectStream)
AddStream adds the stream into given objects. Checks if given object doesn't exists already.
func (d *Document) FindCatalog() (*Catalog, bool)
FindCatalog finds document catalog from the input objects.
func (d *Document) GetPages() ([]Page, bool)
GetPages gets all document pages.
type Image struct {
Name string
Width int
Height int
Colorspace core.PdfObjectName
ColorComponents int
BitsPerComponent int
SMask *ImageSMask
Stream *core.PdfObjectStream
}
type ImageSMask struct {
Image *Image
Stream *core.PdfObjectStream
}
OutputIntent is the wrapper over object that is meant to be an object intent.
type OutputIntent struct {
Object *core.PdfObjectDictionary
}
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 (o *OutputIntents) Add(oi core.PdfObject) error
Add new output intent into given output intents model.
func (o *OutputIntents) Get(i int) (OutputIntent, bool)
Get the object intent at the i'th position.
func (o *OutputIntents) Len() int
Len gets the length of the object intents array.
Page is a wrapper over the Page core.PdfObjectDictionary.
type Page struct {
Object *core.PdfObjectDictionary
// contains filtered or unexported fields
}
func (p Page) FindXObjectForms() []*core.PdfObjectStream
FindXObjectForms finds page XObject forms.
func (p Page) FindXObjectImages() ([]*Image, error)
FindXObjectImages finds XObject images for given page.
func (p Page) GetContents() ([]Content, bool)
GetContents gets all page contents.
func (p Page) GetResources() (*core.PdfObjectDictionary, bool)
GetResources gets page resources dictionary.
func (p Page) GetResourcesXObject() (*core.PdfObjectDictionary, bool)
GetResourcesXObject gets the page resources XObject.
func (p *Page) Number() int
Number gets the page number.