Documentation
¶
Index ¶
- func ApplyDocumentUnits(svg *Csvg__svg, ladder *Ladder) error
- func ApplyDocumentUnitsScaleLayout(svg *Csvg__svg, layout *Layout) error
- func DiffPosition(from, to geo.Point) geo.Point
- func PrettyPrintLayout(layout *Layout) error
- func PrettyPrintStruct(layout interface{}) error
- func PrintLayout(layout *Layout) error
- func RenderSpread(svgLayoutPath string, spreadName string, previousImagePath string, ...) error
- func RenderSpreadExtra(contents SpreadContents) error
- func TranslatePosition(pos, vec geo.Point) geo.Point
- func UnmarshalTextPrefill(tp *TextPrefill) error
- type Action
- type CRDF__rdf
- type CWork__cc
- type Cdefs__svg
- type Cdesc__svg
- type Cformat__dc
- type Cg__svg
- type Cmetadata__svg
- type Cnamedview__sodipodi
- type Cpath__svg
- type Crect__svg
- type Csvg__svg
- type Ctitle__dc
- type Ctitle__svg
- type Ctype__dc
- type DocPrefills
- type ImageInsert
- type Ladder
- type Layout
- type MetaData
- type PagePrefills
- type Paragraph
- type Spread
- type SpreadContents
- type TextField
- type TextPrefill
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDocumentUnits ¶
func PrettyPrintLayout ¶
func PrettyPrintStruct ¶
func PrettyPrintStruct(layout interface{}) error
func PrintLayout ¶
func RenderSpread ¶
func RenderSpreadExtra ¶
func RenderSpreadExtra(contents SpreadContents) error
func UnmarshalTextPrefill ¶
func UnmarshalTextPrefill(tp *TextPrefill) error
Types ¶
type CWork__cc ¶
type CWork__cc struct {
XMLName xml.Name `xml:"Work,omitempty" json:"Work,omitempty"`
AttrRdfSpaceabout string `xml:"http://www.w3.org/1999/02/22-rdf-syntax-ns# about,attr" json:",omitempty"`
Cformat__dc *Cformat__dc `xml:"http://purl.org/dc/elements/1.1/ format,omitempty" json:"format,omitempty"`
Ctitle__dc *Ctitle__dc `xml:"http://purl.org/dc/elements/1.1/ title,omitempty" json:"title,omitempty"`
Ctype__dc *Ctype__dc `xml:"http://purl.org/dc/elements/1.1/ type,omitempty" json:"type,omitempty"`
}
type Cdefs__svg ¶
type Cdesc__svg ¶
type Cformat__dc ¶
type Cg__svg ¶
type Cg__svg struct {
XMLName xml.Name `xml:"g,omitempty" json:"g,omitempty"`
AttrInkscapeSpacegroupmode string `xml:"http://www.inkscape.org/namespaces/inkscape groupmode,attr" json:",omitempty"`
Attrid string `xml:"id,attr" json:",omitempty"`
AttrInkscapeSpacelabel string `xml:"http://www.inkscape.org/namespaces/inkscape label,attr" json:",omitempty"`
Attrstyle string `xml:"style,attr" json:",omitempty"`
Cpath__svg []*Cpath__svg `xml:"http://www.w3.org/2000/svg path,omitempty" json:"path,omitempty"`
Crect__svg []*Crect__svg `xml:"http://www.w3.org/2000/svg rect,omitempty" json:"rect,omitempty"`
Transform string `xml:"transform,attr" json:",omitempty"`
}
type Cmetadata__svg ¶
type Cnamedview__sodipodi ¶
type Cnamedview__sodipodi struct {
XMLName xml.Name `xml:"namedview,omitempty" json:"namedview,omitempty"`
Attrbordercolor string `xml:"bordercolor,attr" json:",omitempty"`
Attrborderopacity string `xml:"borderopacity,attr" json:",omitempty"`
AttrInkscapeSpacecurrent_dash_layer string `xml:"http://www.inkscape.org/namespaces/inkscape current-layer,attr" json:",omitempty"`
AttrInkscapeSpacecx string `xml:"http://www.inkscape.org/namespaces/inkscape cx,attr" json:",omitempty"`
AttrInkscapeSpacecy string `xml:"http://www.inkscape.org/namespaces/inkscape cy,attr" json:",omitempty"`
AttrInkscapeSpacedocument_dash_units string `xml:"http://www.inkscape.org/namespaces/inkscape document-units,attr" json:",omitempty"`
Attrid string `xml:"id,attr" json:",omitempty"`
Attrpagecolor string `xml:"pagecolor,attr" json:",omitempty"`
AttrInkscapeSpacepageopacity string `xml:"http://www.inkscape.org/namespaces/inkscape pageopacity,attr" json:",omitempty"`
AttrInkscapeSpacepageshadow string `xml:"http://www.inkscape.org/namespaces/inkscape pageshadow,attr" json:",omitempty"`
Attrshowgrid string `xml:"showgrid,attr" json:",omitempty"`
AttrInkscapeSpacesnap_dash_center string `xml:"http://www.inkscape.org/namespaces/inkscape snap-center,attr" json:",omitempty"`
AttrInkscapeSpacesnap_dash_global string `xml:"http://www.inkscape.org/namespaces/inkscape snap-global,attr" json:",omitempty"`
AttrInkscapeSpacesnap_dash_page string `xml:"http://www.inkscape.org/namespaces/inkscape snap-page,attr" json:",omitempty"`
AttrInkscapeSpacewindow_dash_height string `xml:"http://www.inkscape.org/namespaces/inkscape window-height,attr" json:",omitempty"`
AttrInkscapeSpacewindow_dash_maximized string `xml:"http://www.inkscape.org/namespaces/inkscape window-maximized,attr" json:",omitempty"`
AttrInkscapeSpacewindow_dash_width string `xml:"http://www.inkscape.org/namespaces/inkscape window-width,attr" json:",omitempty"`
AttrInkscapeSpacewindow_dash_x string `xml:"http://www.inkscape.org/namespaces/inkscape window-x,attr" json:",omitempty"`
AttrInkscapeSpacewindow_dash_y string `xml:"http://www.inkscape.org/namespaces/inkscape window-y,attr" json:",omitempty"`
AttrInkscapeSpacezoom string `xml:"http://www.inkscape.org/namespaces/inkscape zoom,attr" json:",omitempty"`
}
type Cpath__svg ¶
type Cpath__svg struct {
XMLName xml.Name `xml:"path,omitempty" json:"path,omitempty"`
Cx string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd cx,attr" json:",omitempty"`
Cy string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd cy,attr" json:",omitempty"`
Attrd string `xml:"d,attr" json:",omitempty"`
AttrSodipodiSpaceend string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd end,attr" json:",omitempty"`
ID string `xml:"id,attr" json:",omitempty"`
AttrSodipodiSpaceopen string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd open,attr" json:",omitempty"`
AttrSodipodiSpacerx string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd rx,attr" json:",omitempty"`
AttrSodipodiSpacery string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd ry,attr" json:",omitempty"`
AttrSodipodiSpacestart string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd start,attr" json:",omitempty"`
Attrstyle string `xml:"style,attr" json:",omitempty"`
Transform string `xml:"transform,attr" json:",omitempty"`
AttrSodipodiSpacetype string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd type,attr" json:",omitempty"`
Desc *Cdesc__svg `xml:"http://www.w3.org/2000/svg desc,omitempty" json:"desc,omitempty"`
Title *Ctitle__svg `xml:"http://www.w3.org/2000/svg title,omitempty" json:"title,omitempty"`
}
type Crect__svg ¶
type Crect__svg struct {
XMLName xml.Name `xml:"rect,omitempty" json:"rect,omitempty"`
Height string `xml:"height,attr" json:",omitempty"`
Id string `xml:"id,attr" json:",omitempty"`
Attrstyle string `xml:"style,attr" json:",omitempty"`
Width string `xml:"width,attr" json:",omitempty"`
Rx string `xml:"x,attr" json:",omitempty"`
Ry string `xml:"y,attr" json:",omitempty"`
Desc *Cdesc__svg `xml:"http://www.w3.org/2000/svg desc,omitempty" json:"desc,omitempty"`
Title *Ctitle__svg `xml:"http://www.w3.org/2000/svg title,omitempty" json:"title,omitempty"`
Transform string `xml:"transform,attr" json:",omitempty"`
}
type Csvg__svg ¶
type Csvg__svg struct {
XMLName xml.Name `xml:"svg,omitempty" json:"svg,omitempty"`
AttrXmlnscc string `xml:"xmlns cc,attr" json:",omitempty"`
AttrXmlnsdc string `xml:"xmlns dc,attr" json:",omitempty"`
AttrSodipodiSpacedocname string `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd docname,attr" json:",omitempty"`
AttrInkscapeSpaceexport_dash_filename string `xml:"http://www.inkscape.org/namespaces/inkscape export-filename,attr" json:",omitempty"`
AttrInkscapeSpaceexport_dash_xdpi string `xml:"http://www.inkscape.org/namespaces/inkscape export-xdpi,attr" json:",omitempty"`
AttrInkscapeSpaceexport_dash_ydpi string `xml:"http://www.inkscape.org/namespaces/inkscape export-ydpi,attr" json:",omitempty"`
Height string `xml:"height,attr" json:",omitempty"`
Attrid string `xml:"id,attr" json:",omitempty"`
AttrXmlnsinkscape string `xml:"xmlns inkscape,attr" json:",omitempty"`
AttrXmlnsrdf string `xml:"xmlns rdf,attr" json:",omitempty"`
AttrXmlnssodipodi string `xml:"xmlns sodipodi,attr" json:",omitempty"`
AttrXmlnssvg string `xml:"xmlns svg,attr" json:",omitempty"`
Attrversion string `xml:"version,attr" json:",omitempty"`
AttrviewBox string `xml:"viewBox,attr" json:",omitempty"`
Width string `xml:"width,attr" json:",omitempty"`
Attrxmlns string `xml:"xmlns,attr" json:",omitempty"`
Cdefs__svg *Cdefs__svg `xml:"http://www.w3.org/2000/svg defs,omitempty" json:"defs,omitempty"`
Cg__svg []*Cg__svg `xml:"http://www.w3.org/2000/svg g,omitempty" json:"g,omitempty"`
Cmetadata__svg *Cmetadata__svg `xml:"http://www.w3.org/2000/svg metadata,omitempty" json:"metadata,omitempty"`
Cnamedview__sodipodi *Cnamedview__sodipodi `xml:"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd namedview,omitempty" json:"namedview,omitempty"`
Ctitle__svg *Ctitle__svg `xml:"http://www.w3.org/2000/svg title,omitempty" json:"title,omitempty"`
}
type Ctitle__dc ¶
type Ctitle__svg ¶
type DocPrefills ¶
type DocPrefills map[int]PagePrefills
type Ladder ¶
type Ladder struct {
Anchor geo.Point
Dim geo.Dim
ID string
TextFields []TextField
TextPrefills []TextPrefill
}
func DefineLadderFromSVG ¶
type Layout ¶
type Layout struct {
Anchor geo.Point `json:"anchor"`
Dim geo.Dim `json:"dim"`
ID string `json:"id"`
Anchors map[string]geo.Point `json:"anchors"`
PageDims map[string]geo.Dim `json:"pageDims"`
Filenames map[string]string `json:"filenames"`
ImageDims map[string]geo.Dim `json:"ImageDims"`
}
func DefineLayoutFromSVG ¶
type PagePrefills ¶
type Paragraph ¶
type Paragraph struct {
Text string `json:"text"`
TextFont string `json:"textFont"`
TextSize float64 `json:"textSize"`
LineHeight float64 `json:"lineHeight"`
Alignment string `json:"alignment"`
EnableWrap bool `json:"enableWrap"`
WrapWidth float64 `json:"wrapWidth"`
Angle float64 `json:"angle"`
AbsolutePositioning bool `json:"absolutePositioning"`
Margins []float64 `json:"margins"`
XPos float64 `json:"xpos"`
YPos float64 `json:"ypos"`
ColorHex string `json:"colorHex"`
}
we read the properties from a JSON object in the Description field and then apply when writing the text field - these are private fields in the Paragraph struct in unipdf
type Spread ¶
type Spread struct {
Name string
Dim geo.Dim
ExtraWidth float64
Images []ImageInsert
Ladders []Ladder
TextFields []TextField
TextPrefills []TextPrefill
}
TODO move this to types.go; add json tags
type SpreadContents ¶
type SpreadContents struct {
SvgLayoutPath string
SpreadName string
PreviousImagePath string
PrefillImagePaths map[string]string
Comments pdfcomment.Comments
PageNumber int
PdfOutputPath string
Exam string
Candidate string
PageData pdfpagedata.PageData
Prefills DocPrefills
TemplatePathsRelative bool
PrefillImagePathsRelative bool
}
Click to show internal directories.
Click to hide internal directories.













