Documentation ¶
Index ¶
- Variables
- func Logf(format string, args ...interface{})
- func ParseAndBuild(source string, target string) error
- func RGBAFromHexColor(s string) color.RGBA
- type Box
- type Default
- type Document
- type Font
- type Format
- type Image
- type Instruction
- type Instructions
- type LineFeed
- type Meta
- type NoStyles
- type Orientation
- type PageBreakMode
- type PageMargins
- type ProcessOption
- type Processor
- type Registry
- type SetX
- type SetXY
- type SetY
- type Styled
- type Table
- type TableCell
- type TableRow
- type Text
- type Unit
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStyle = style.Styles{ Font: style.Font{ Family: "Arial", PointSize: 12, Style: style.FontStyleNormal, Weight: style.FontWeightNormal, Decoration: style.FontDecorationNormal, }, Box: style.Box{ Border: style.Border{Left: 0, Top: 0, Right: 0, Bottom: 0}, Padding: style.Padding{Left: 0, Top: 0, Right: 0, Bottom: 0}, Margin: style.Margin{Left: 0, Top: 0, Right: 0, Bottom: 0}, }, Dimension: style.Dimension{ Width: -1, Height: -1, LineHeight: 1.5, OffsetX: 0, OffsetY: 0, }, Table: style.Table{ ColumnWidth: -1, ColumnSpan: 1, }, Align: style.Align{ HAlign: style.HAlignLeft, VAlign: style.VAlignTop, }, Color: style.Color{ Foreground: style.Black, Text: style.Black, Background: style.White, }, }
Functions ¶
func ParseAndBuild ¶
func RGBAFromHexColor ¶
Types ¶
type Default ¶
type Default struct { XMLName xml.Name `xml:"default"` Orientation Orientation `xml:"orientation"` Unit Unit `xml:"unit"` Format Format `xml:"format"` PageBreaks PageBreakMode `xml:"page-breaks"` PageMargins PageMargins `xml:"page-margins"` }
type Document ¶
type Document struct { XMLName xml.Name `xml:"document"` Meta Meta `xml:"meta"` Default Default `xml:"default"` Style string `xml:"style"` Header Instructions `xml:"header"` Body Instructions `xml:"body"` // contains filtered or unexported fields }
func LoadFromFile ¶
func (*Document) StyleClasses ¶
type Instruction ¶
type Instructions ¶
type Instructions struct { Styled // contains filtered or unexported fields }
func (*Instructions) UnmarshalXML ¶
func (is *Instructions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type Orientation ¶
type Orientation string
const ( OrientationPortrait Orientation = "portrait" OrientationLandscape Orientation = "landscape" )
type PageBreakMode ¶
type PageBreakMode string
const ( PageBreakModeAuto PageBreakMode = "auto" PageBreakModeManual PageBreakMode = "manual" )
type PageMargins ¶
type ProcessOption ¶
func WithCodePage ¶
func WithCodePage(cp string) ProcessOption
func WithFontDir ¶
func WithFontDir(dir string) ProcessOption
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor(doc *Document, options ...ProcessOption) (*Processor, error)
func (*Processor) ColumnWidths ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Decode ¶
func (r *Registry) Decode(d *xml.Decoder, start xml.StartElement) (Instruction, error)
func (*Registry) Register ¶
func (r *Registry) Register(prototype Instruction) error
type Styled ¶
func (*Styled) ApplyWithSelector ¶
type TableCell ¶
type TableCell struct { Styled XMLName xml.Name `xml:"td"` Content string `xml:",chardata"` Instructions []Instruction // contains filtered or unexported fields }
func (*TableCell) UnmarshalXML ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.