Documentation ¶
Index ¶
- type AP
- type Bar
- type Border
- type Buttons
- type CheckBox
- type Content
- type Divider
- type FieldFlags
- type FormFont
- type Guide
- type HorizontalBand
- type ImageBox
- type ImageData
- type Margin
- type PDF
- type PDFPage
- type Padding
- type RadioButtonGroup
- type Regions
- type SimpleBox
- type Table
- type TableHeader
- type TextBox
- type TextField
- type TextFieldLabel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buttons ¶
type Buttons struct { Values []string Label *TextFieldLabel // contains filtered or unexported fields }
type Content ¶
type Content struct { BackgroundColor string `json:"bgCol"` Fonts map[string]*FormFont // named fonts Margins map[string]*Margin // named margins Borders map[string]*Border // named borders Paddings map[string]*Padding // named paddings Margin *Margin // content margin Border *Border // content border Padding *Padding // content padding Regions *Regions Guides []*Guide // hor/vert guidelines for layout Bars []*Bar `json:"bar"` SimpleBoxes []*SimpleBox `json:"box"` SimpleBoxPool map[string]*SimpleBox `json:"boxes"` TextBoxes []*TextBox `json:"text"` TextBoxPool map[string]*TextBox `json:"texts"` ImageBoxes []*ImageBox `json:"image"` ImageBoxPool map[string]*ImageBox `json:"images"` Tables []*Table `json:"table"` TablePool map[string]*Table `json:"tables"` // Form elements TextFields []*TextField `json:"textfield"` // input text fields with optional label CheckBoxes []*CheckBox `json:"checkbox"` // input checkboxes with optional label RadioButtonGroups []*RadioButtonGroup `json:"radiobuttongroup"` // input radiobutton groups with optional label // contains filtered or unexported fields }
func (*Content) BorderRect ¶
type FieldFlags ¶
type FieldFlags int
FieldFlags represents the PDF form field flags.
const ( FieldReadOnly FieldFlags = 1 << iota FieldRequired FieldNoExport UnusedFlag4 UnusedFlag5 UnusedFlag6 UnusedFlag7 UnusedFlag8 UnusedFlag9 UnusedFlag10 UnusedFlag11 UnusedFlag12 FieldMultiline FieldPassword FieldNoToggleToOff FieldRadio FieldCombo FieldEdit FieldSort FieldFileSelect FieldMultiselect FieldDoNotSpellCheck FieldDoNotScroll FieldComb FieldRichTextAndRadiosInUnison FieldCommitOnSelChange )
type Guide ¶
type Guide struct { Position [2]float64 `json:"pos"` // x,y // contains filtered or unexported fields }
Guide represents horizontal and vertical lines at (x,y) for layout purposes.
type HorizontalBand ¶
type ImageBox ¶
type ImageBox struct { Name string FileName string `json:"file"` // path of image file name Data *ImageData // TODO Position [2]float64 `json:"pos"` // x,y Dx, Dy float64 Anchor string Width float64 Height float64 Margin *Margin Border *Border Padding *Padding BackgroundColor string `json:"bgCol"` Rotation float64 `json:"rot"` Url string Hide bool // contains filtered or unexported fields }
type PDF ¶
type PDF struct { Paper string // default paper size Crop string // default crop box Origin string // origin of the coordinate system Guides bool // render guides for layouting ContentBox bool // render contentBox = cropBox - header - footer BackgroundColor string `json:"bgCol"` Fonts map[string]*FormFont // default fonts FormFontIDs map[string]string FieldIDs pdfcpu.StringSet Fields pdfcpu.Array InheritedDA string Header *HorizontalBand Pages map[string]*PDFPage Margin *Margin // the global margin named "margin" Border *Border // the global border named "border" Padding *Padding // the global padding named "padding" Margins map[string]*Margin // global named margins Borders map[string]*Border // global named borders Paddings map[string]*Padding // global named paddings SimpleBoxPool map[string]*SimpleBox `json:"boxes"` TextBoxPool map[string]*TextBox `json:"texts"` ImageBoxPool map[string]*ImageBox `json:"images"` TablePool map[string]*Table `json:"tables"` Colors map[string]string DirNames map[string]string `json:"dirs"` FileNames map[string]string `json:"files"` TimestampFormat string `json:"timestamp"` Conf *pdfcpu.Configuration XRefTable *pdfcpu.XRefTable Optimize *pdfcpu.OptimizationContext FontResIDs map[int]pdfcpu.Dict XObjectResIDs map[int]pdfcpu.Dict CheckBoxAPs map[float64]*AP RadioBtnAPs map[float64]*AP HasForm bool // contains filtered or unexported fields }
func (*PDF) RenderPages ¶
type PDFPage ¶
type PDFPage struct { Paper string // page size Crop string // page crop box BackgroundColor string `json:"bgCol"` Fonts map[string]*FormFont // default fonts DA pdfcpu.Object Guides []*Guide // hor/vert guidelines for layout Margin *Margin // page margin Border *Border // page border Padding *Padding // page padding Margins map[string]*Margin // page scoped named margins Borders map[string]*Border // page scoped named borders Paddings map[string]*Padding // page scoped named paddings SimpleBoxPool map[string]*SimpleBox `json:"boxes"` TextBoxPool map[string]*TextBox `json:"texts"` ImageBoxPool map[string]*ImageBox `json:"images"` TablePool map[string]*Table `json:"tables"` FileNames map[string]string `json:"files"` Content *Content // contains filtered or unexported fields }
type RadioButtonGroup ¶
type Table ¶
type Table struct { Name string Values [][]string Position [2]float64 `json:"pos"` // x,y Dx, Dy float64 Anchor string Width float64 // if < 1 then fraction of content width Rows, Cols int ColWidths []float64 // optional width fractions, 0 < x < 1 must total 1 ColAnchors []string LineHeight int `json:"lheight"` Font *FormFont Margin *Margin Border *Border Padding *Padding BackgroundColor string `json:"bgCol"` OddColor string `json:"oddCol"` EvenColor string `json:"evenCol"` Rotation float64 `json:"rot"` Grid bool Hide bool Header *TableHeader // contains filtered or unexported fields }
type TableHeader ¶
type TextBox ¶
type TextBox struct { Name string Value string // text, content Position [2]float64 `json:"pos"` // x,y Dx, Dy float64 Anchor string Width float64 Font *FormFont Margin *Margin // applied to content box Border *Border Padding *Padding // applied to TextDescriptor marginx BackgroundColor string `json:"bgCol"` Alignment string `json:"align"` // "Left", "Center", "Right" RTL bool Rotation float64 `json:"rot"` Hide bool // contains filtered or unexported fields }
type TextField ¶
type TextField struct { Label *TextFieldLabel ID string Value string Position [2]float64 `json:"pos"` // x,y Width float64 Height float64 Dx, Dy float64 Multiline bool Font *FormFont // optional Margin *Margin // applied to content box Border *Border BackgroundColor string `json:"bgCol"` Alignment string `json:"align"` // "Left", "Center", "Right" RTL bool Rotation float64 `json:"rot"` Hide bool // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.