Documentation ¶
Index ¶
- type Document
- type PDF
- func (pdf *PDF) AddPage(input io.Reader)
- func (pdf *PDF) AddPageFromString(content string)
- func (pdf *PDF) AddPageFromURL(url string)
- func (pdf *PDF) Render(writer io.Writer) error
- func (pdf *PDF) RenderByContent(writer io.Writer, content string) error
- func (pdf *PDF) RenderByTemplate(writer io.Writer, templateName string, data template.Context) error
- func (pdf *PDF) RenderByVirtualTemplate(writer io.Writer, templateContent string, data template.Context) error
- func (pdf *PDF) SetOptions(option Document)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct { Orientation string `json:"orientation"` PageSize string `json:"pageSize"` MarginBottom uint `json:"marginBottom"` MarginTop uint `json:"marginTop"` MarginLeft uint `json:"marginLeft"` MarginRight uint `json:"marginRight"` }
Document refers the information of page viewing
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF is structure of PDF generator
func (*PDF) AddPageFromString ¶
AddPageFromString generates PDF pages including string
func (*PDF) AddPageFromURL ¶
AddPageFromURL generates PDF pages from URL
func (*PDF) RenderByContent ¶
RenderByContent creates PDF from content to writer
func (*PDF) RenderByTemplate ¶
func (pdf *PDF) RenderByTemplate(writer io.Writer, templateName string, data template.Context) error
RenderByTemplate creates PDF from template and data to writer
func (*PDF) RenderByVirtualTemplate ¶
func (pdf *PDF) RenderByVirtualTemplate(writer io.Writer, templateContent string, data template.Context) error
RenderByVirtualTemplate creates PDF from specified template content and data to writer
func (*PDF) SetOptions ¶
SetOptions settle margin and page size of PDF
Click to show internal directories.
Click to hide internal directories.