Documentation ¶
Index ¶
- type Importer
- func (imp *Importer) GetImportedObjects() map[int][]byte
- func (imp *Importer) GetNumPages() (int, error)
- func (imp *Importer) GetPageSizes() (map[int]map[string]map[string]float64, error)
- func (imp *Importer) ImportPage(pageno int, box string) (int, error)
- func (imp *Importer) PutFormXobjects() (map[string]int, error)
- func (imp *Importer) SetNextObjectID(objID int)
- func (imp *Importer) SetObjIDGetter(f func() int)
- func (imp *Importer) SetSourceStream(rs io.ReadSeeker) error
- type PdfObject
- type PdfObjectID
- type PdfTemplate
- type PdfWriter
- func (pw *PdfWriter) ClearImportedObjects()
- func (pw *PdfWriter) GetImportedObjects() map[*PdfObjectID][]byte
- func (pw *PdfWriter) GetPDFBoxDimensions(p int, boxname string) (map[string]float64, error)
- func (pw *PdfWriter) ImportPage(rd *reader.PdfReader, pageno int, boxName string) (int, error)
- func (pw *PdfWriter) PutFormXobjects(reader *reader.PdfReader) (map[string]*PdfObjectID, error)
- func (pw *PdfWriter) SetNextObjectID(id int)
- func (pw *PdfWriter) SetTplIDOffset(n int)
- type TplInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
The Importer class to be used by a pdf generation library
func (*Importer) GetImportedObjects ¶
GetImportedObjects gets object ids (int) and their contents ([]byte)
func (*Importer) GetNumPages ¶
GetNumPages returns the number of pages in the PDF document
func (*Importer) GetPageSizes ¶
GetPageSizes returns the page sizes for all pages
func (*Importer) ImportPage ¶
ImportPage imports a page and returns the template number
func (*Importer) PutFormXobjects ¶
PutFormXobjects puts form xobjects and get back a map of template names (e.g. /GOFPDITPL1) and their object ids (int)
func (*Importer) SetNextObjectID ¶
SetNextObjectID sets the start object number the generated PDF code has.
func (*Importer) SetObjIDGetter ¶
SetObjIDGetter sets a function that is called each time the PDF writer should generate a new object number
func (*Importer) SetSourceStream ¶
func (imp *Importer) SetSourceStream(rs io.ReadSeeker) error
SetSourceStream sets the importer source by providing a io.ReadSeeker
type PdfObjectID ¶
type PdfObjectID struct {
// contains filtered or unexported fields
}
type PdfTemplate ¶
type PdfTemplate struct { ID int Reader *reader.PdfReader Resources *reader.PdfValue Buffer string Box map[string]float64 X float64 Y float64 W float64 H float64 Rotation int N int }
Done with parsing. Now, create templates.
type PdfWriter ¶
type PdfWriter struct { NextObjectID func() int // contains filtered or unexported fields }
func NewPdfWriter ¶
func NewPdfWriter() *PdfWriter
func (*PdfWriter) ClearImportedObjects ¶
func (pw *PdfWriter) ClearImportedObjects()
ClearImportedObjects deletes all imported objects
func (*PdfWriter) GetImportedObjects ¶
func (pw *PdfWriter) GetImportedObjects() map[*PdfObjectID][]byte
GetImportedObjects returns all byte slices for the imported objects
func (*PdfWriter) GetPDFBoxDimensions ¶
GetPDFBoxDimensions returns the dimensions for the given box. Box must be one of "/MediaBox", "/CropBox", "/BleedBox", "/TrimBox", "/ArtBox".
func (*PdfWriter) ImportPage ¶
ImportPage creates a PdfTemplate object from a page number (e.g. 1) and a boxName (e.g. /MediaBox)
func (*PdfWriter) PutFormXobjects ¶
PutFormXobjects puts form xobjects and get back a map of template names (e.g. /GOFPDITPL1) and their object ids (int)