Documentation ¶
Index ¶
- Constants
- Variables
- func DrawSlice(page *Page, fillColor int32, xc, yc, r1, r2, a1, a2 float32) float32
- func FontStream1(pdf *PDF, font *Font, reader io.Reader)
- func FontStream2(objects *[]*PDFobj, font *Font, reader io.Reader)
- func GetControlPoints(xc, yc, x0, y0, x3, y3 float32) [][2]float32
- func GetPoint(xc, yc, radius, angle float32) [2]float32
- func NewColorMap() map[string]int32
- func PrintDuration(example string, duration time.Duration)
- func ReadTextLines(filePath string) []string
- func ReorderVisually(text string) string
- func XMarkCheckBox(page *Page, x, y, size float32)
- type Annotation
- type BMPImage
- type Barcode
- func (barcode *Barcode) DrawOn(page *Page) []float32
- func (barcode *Barcode) GetHeight() float32
- func (barcode *Barcode) SetBarHeightFactor(barHeightFactor float32)
- func (barcode *Barcode) SetDirection(direction int)
- func (barcode *Barcode) SetFont(font *Font)
- func (barcode *Barcode) SetLocation(x1, y1 float32)
- func (barcode *Barcode) SetModuleLength(moduleLength float32)
- type Barcode2D
- type Bookmark
- type Box
- func (box *Box) DrawOn(page *Page) []float32
- func (box *Box) PlaceIn(box2 *Box, xOffset, yOffset float32)
- func (box *Box) ScaleBy(factor float32)
- func (box *Box) SetActualText(actualText string) *Box
- func (box *Box) SetAltDescription(altDescription string) *Box
- func (box *Box) SetColor(color int32)
- func (box *Box) SetFillShape(fillShape bool)
- func (box *Box) SetGoToAction(key *string)
- func (box *Box) SetLineWidth(width float32)
- func (box *Box) SetLocation(x, y float32) *Box
- func (box *Box) SetPattern(pattern string)
- func (box *Box) SetSize(w, h float32)
- func (box *Box) SetStructureType(structureType string) *Box
- func (box *Box) SetURIAction(uri *string)
- type CalendarMonth
- func (calendarMonth *CalendarMonth) DrawOn(page *Page)
- func (calendarMonth *CalendarMonth) NewCalendarMonth(f1, f2 *Font, year, month int)
- func (calendarMonth *CalendarMonth) SetBodyFont(font *Font)
- func (calendarMonth *CalendarMonth) SetCellHeight(height float32)
- func (calendarMonth *CalendarMonth) SetCellWidth(width float32)
- func (calendarMonth *CalendarMonth) SetHeadFont(font *Font)
- func (calendarMonth *CalendarMonth) SetLocation(x, y float32)
- type Cell
- func (cell *Cell) DrawOn(page *Page, x, y, w, h float32)
- func (cell *Cell) DrawText(page *Page, x, y, wCell, hCell float32)
- func (cell *Cell) GetBgColor() int32
- func (cell *Cell) GetBorder(border int) bool
- func (cell *Cell) GetBrushColor() int32
- func (cell *Cell) GetColSpan() int
- func (cell *Cell) GetCompositeTextLine() *CompositeTextLine
- func (cell *Cell) GetFallbackFont() *Font
- func (cell *Cell) GetFont() *Font
- func (cell *Cell) GetHeight(width float32) float32
- func (cell *Cell) GetImage() *Image
- func (cell *Cell) GetLineWidth() float32
- func (cell *Cell) GetPenColor() int32
- func (cell *Cell) GetPoint() *Point
- func (cell *Cell) GetProperties() uint32
- func (cell *Cell) GetStrikeout() bool
- func (cell *Cell) GetText() string
- func (cell *Cell) GetTextAlignment() int
- func (cell *Cell) GetTextBox() *TextBox
- func (cell *Cell) GetUnderline() bool
- func (cell *Cell) GetVerTextAlignment() int
- func (cell *Cell) GetWidth() float32
- func (cell *Cell) SetBarcode(barcode *Barcode)
- func (cell *Cell) SetBgColor(color int32)
- func (cell *Cell) SetBorder(border int, visible bool)
- func (cell *Cell) SetBorders(borders bool)
- func (cell *Cell) SetBottomPadding(padding float32)
- func (cell *Cell) SetBrushColor(color int32)
- func (cell *Cell) SetColSpan(colspan int)
- func (cell *Cell) SetCompositeTextLine(compositeTextLine *CompositeTextLine)
- func (cell *Cell) SetFallbackFont(fallbackFont *Font)
- func (cell *Cell) SetFgColor(color int32)
- func (cell *Cell) SetFont(font *Font)
- func (cell *Cell) SetImage(image *Image)
- func (cell *Cell) SetLeftPadding(padding float32)
- func (cell *Cell) SetLineWidth(lineWidth float32)
- func (cell *Cell) SetPadding(padding float32)
- func (cell *Cell) SetPenColor(color int32)
- func (cell *Cell) SetPoint(point *Point)
- func (cell *Cell) SetProperties(properties uint32)
- func (cell *Cell) SetRightPadding(padding float32)
- func (cell *Cell) SetStrikeout(strikeout bool)
- func (cell *Cell) SetText(text string)
- func (cell *Cell) SetTextAlignment(alignment int)
- func (cell *Cell) SetTextBox(textBox *TextBox)
- func (cell *Cell) SetTopPadding(padding float32)
- func (cell *Cell) SetURIAction(uri *string)
- func (cell *Cell) SetUnderline(underline bool)
- func (cell *Cell) SetVerTextAlignment(alignment int)
- func (cell *Cell) SetWidth(width float32)
- func (cell *Cell) StrikeoutText(page *Page, font *Font, text string, x, y float32)
- func (cell *Cell) UnderlineText(page *Page, font *Font, text string, x, y float32)
- type Chart
- func (chart *Chart) DrawOn(page *Page)
- func (chart *Chart) DrawXAxisLabels(page *Page)
- func (chart *Chart) DrawYAxisLabels(page *Page)
- func (chart *Chart) GetData() [][]*Point
- func (chart *Chart) Intercept(points []*Point, slope float32) float32
- func (chart *Chart) SetData(chartData [][]*Point)
- func (chart *Chart) SetDrawXAxisLabels(drawXAxisLabels bool)
- func (chart *Chart) SetDrawXAxisLines(drawXAxisLines bool)
- func (chart *Chart) SetDrawYAxisLabels(drawYAxisLabels bool)
- func (chart *Chart) SetDrawYAxisLines(drawYAxisLines bool)
- func (chart *Chart) SetLocation(x, y float32)
- func (chart *Chart) SetMaximumFractionDigits(maxFractionDigits int)
- func (chart *Chart) SetMinimumFractionDigits(minFractionDigits int)
- func (chart *Chart) SetSize(w, h float32)
- func (chart *Chart) SetTitle(title string)
- func (chart *Chart) SetXAxisMinMax(xMin, xMax float32, xAxisGridLines int)
- func (chart *Chart) SetXAxisTitle(title string)
- func (chart *Chart) SetXYChart(xyChart bool)
- func (chart *Chart) SetYAxisMinMax(yMin, yMax float32, yAxisGridLines int)
- func (chart *Chart) SetYAxisTitle(title string)
- func (chart *Chart) Slope(points []*Point) float32
- type CheckBox
- func (checkBox *CheckBox) Check(mark int) *CheckBox
- func (checkBox *CheckBox) DrawOn(page Page) []float32
- func (checkBox *CheckBox) GetHeight() float32
- func (checkBox *CheckBox) GetWidth() float32
- func (checkBox *CheckBox) SetActualText(actualText string) *CheckBox
- func (checkBox *CheckBox) SetAltDescription(altDescription string) *CheckBox
- func (checkBox *CheckBox) SetBoxColor(boxColor int32) *CheckBox
- func (checkBox *CheckBox) SetCheckmark(checkColor int32) *CheckBox
- func (checkBox *CheckBox) SetFontSize(fontSize float32) *CheckBox
- func (checkBox *CheckBox) SetLocation(x, y float32) *CheckBox
- func (checkBox *CheckBox) SetURIAction(uri *string) *CheckBox
- type Chunk
- type CompositeTextLine
- func (composite *CompositeTextLine) AddComponent(textLine *TextLine)
- func (composite *CompositeTextLine) DrawOn(page *Page) []float32
- func (composite *CompositeTextLine) GetFontSize() float32
- func (composite *CompositeTextLine) GetHeight() float32
- func (composite *CompositeTextLine) GetMinMax() []float32
- func (composite *CompositeTextLine) GetNumberOfTextLines() int
- func (composite *CompositeTextLine) GetPosition() [2]float32
- func (composite *CompositeTextLine) GetSubscriptFactor() float32
- func (composite *CompositeTextLine) GetSubscriptPosition() float32
- func (composite *CompositeTextLine) GetSuperscriptFactor() float32
- func (composite *CompositeTextLine) GetSuperscriptPosition() float32
- func (composite *CompositeTextLine) GetTextLine(index int) *TextLine
- func (composite *CompositeTextLine) GetWidth() float32
- func (composite *CompositeTextLine) SetFontSize(fontSize float32)
- func (composite *CompositeTextLine) SetLocation(x, y float32)
- func (composite *CompositeTextLine) SetSubscriptPosition(subscriptPosition float32)
- func (composite *CompositeTextLine) SetSuperscriptFactor(superscript float32)
- func (composite *CompositeTextLine) SetSuperscriptPosition(superscriptPosition float32)
- type Destination
- type Dimension
- type DonutChart
- type Drawable
- type EmbeddedFile
- type Field
- type FileAttachment
- func (attachment *FileAttachment) DrawOn(page *Page) [2]float32
- func (attachment *FileAttachment) SetDescription(description string)
- func (attachment *FileAttachment) SetIconPaperclip()
- func (attachment *FileAttachment) SetIconPushPin()
- func (attachment *FileAttachment) SetIconSize(height float32)
- func (attachment *FileAttachment) SetLocation(x, y float32)
- func (attachment *FileAttachment) SetTitle(title string)
- type Font
- func NewCJKFont(pdf *PDF, fontName string) *Font
- func NewCoreFont(pdf *PDF, coreFont *corefont.CoreFont) *Font
- func NewCoreFontForPDFobj(coreFont *corefont.CoreFont) *Font
- func NewFont(pdf *PDF, reader io.Reader) *Font
- func NewFontFromFile(pdf *PDF, filePath string) *Font
- func NewFontStream1(pdf *PDF, reader io.Reader) *Font
- func NewFontStream2(objects *[]*PDFobj, reader io.Reader) *Font
- func (font *Font) GetAscent() float32
- func (font *Font) GetBodyHeight() float32
- func (font *Font) GetDescent() float32
- func (font *Font) GetFitChars(text string, width float32) int
- func (font *Font) GetHeight() float32
- func (font *Font) GetSize() float32
- func (font *Font) SetItalic(skew15 bool)
- func (font *Font) SetKernPairs(kernPairs bool)
- func (font *Font) SetSize(fontSize float32) *Font
- func (font *Font) StringWidth(fallbackFont *Font, text string) float32
- type FontTable
- type Form
- func (form *Form) DrawOn(page *Page) []float32
- func (form *Form) SetLabelColor(labelColor int32) *Form
- func (form *Form) SetLabelFont(f1 *Font) *Form
- func (form *Form) SetLabelFontSize(labelFontSize float32) *Form
- func (form *Form) SetLocation(x, y float32) *Form
- func (form *Form) SetRowHeight(rowHeight float32) *Form
- func (form *Form) SetRowWidth(rowWidth float32) *Form
- func (form *Form) SetValueColor(valueColor int32) *Form
- func (form *Form) SetValueFont(f2 *Font) *Form
- func (form *Form) SetValueFontSize(valueFontSize float32) *Form
- type GraphicsState
- type Image
- func (image *Image) DrawOn(page *Page) [2]float32
- func (image *Image) FlipUpsideDown(flipUpsideDown bool)
- func (image *Image) GetHeight() float32
- func (image *Image) GetWidth() float32
- func (image *Image) PlaceIn(box *Box)
- func (image *Image) ResizeHeight(height float32) *Image
- func (image *Image) ResizeToFit(page *Page, keepAspectRatio bool)
- func (image *Image) ResizeWidth(width float32) *Image
- func (image *Image) RotateClockwise(degrees int)
- func (image *Image) ScaleBy(factor float32) *Image
- func (image *Image) ScaleByWidthAndHeight(widthFactor, heightFactor float32) *Image
- func (image *Image) SetActualText(actualText string) *Image
- func (image *Image) SetAltDescription(altDescription string) *Image
- func (image *Image) SetGoToAction(key *string)
- func (image *Image) SetLocation(x, y float32) *Image
- func (image *Image) SetPosition(x, y float32)
- func (image *Image) SetURIAction(uri *string)
- type JPGImage
- type Line
- func (line *Line) DrawOn(page *Page) [2]float32
- func (line *Line) GetCapStyle() int
- func (line *Line) GetEndPoint() *Point
- func (line *Line) GetStartPoint() *Point
- func (line *Line) PlaceIn(box *Box, xOffset, yOffset float32) *Line
- func (line *Line) PlaceInBox(box *Box) *Line
- func (line *Line) ScaleBy(factor float32) *Line
- func (line *Line) SetActualText(actualText string) *Line
- func (line *Line) SetAltDescription(altDescription string) *Line
- func (line *Line) SetCapStyle(style int) *Line
- func (line *Line) SetColor(color int32) *Line
- func (line *Line) SetEndPoint(x, y float32) *Line
- func (line *Line) SetPattern(pattern string) *Line
- func (line *Line) SetPointA(x, y float32) *Line
- func (line *Line) SetPointB(x, y float32) *Line
- func (line *Line) SetPosition(x, y float32)
- func (line *Line) SetStartPoint(x, y float32) *Line
- func (line *Line) SetWidth(width float32) *Line
- type OTF
- type OptionalContentGroup
- type PDF
- func (pdf *PDF) AddObjects(objects *[]*PDFobj)
- func (pdf *PDF) AddPage(page *Page)
- func (pdf *PDF) AddResourceObjects(objects []*PDFobj)
- func (pdf *PDF) Complete()
- func (pdf *PDF) GetPageObjects(objects []*PDFobj) []*PDFobj
- func (pdf *PDF) Read(buf []byte) []*PDFobj
- func (pdf *PDF) SetAuthor(author string)
- func (pdf *PDF) SetCompliance(compliance int)
- func (pdf *PDF) SetCreator(creator string)
- func (pdf *PDF) SetKeywords(keywords string)
- func (pdf *PDF) SetLanguage(language string)
- func (pdf *PDF) SetPageLayout(pageLayout string)
- func (pdf *PDF) SetPageMode(pageMode string)
- func (pdf *PDF) SetSubject(subject string)
- func (pdf *PDF) SetTitle(title string)
- type PDFobj
- func (obj *PDFobj) AddFontResource(font *Font, objects *[]*PDFobj)
- func (obj *PDFobj) AddImageResource(image *Image, objects *[]*PDFobj)
- func (obj *PDFobj) GetContentsObject(objects []*PDFobj) *PDFobj
- func (obj *PDFobj) GetData() []byte
- func (obj *PDFobj) GetDict() []string
- func (obj *PDFobj) GetLength(objects []*PDFobj) int
- func (obj *PDFobj) GetObjectNumbers(key string) []int
- func (obj *PDFobj) GetPageSize() [2]float32
- func (obj *PDFobj) SetGraphicsState(gs *GraphicsState, objects *[]*PDFobj)
- func (obj *PDFobj) SetNumber(number int)
- func (obj *PDFobj) SetStream(stream []byte)
- func (obj *PDFobj) SetStreamAndData(buf []byte, length int)
- type PNGImage
- type Page
- func (page *Page) AddAnnotation(annotation *Annotation)
- func (page *Page) AddArtifactBMC()
- func (page *Page) AddBMC(structure, language, actualText, altDescription string)
- func (page *Page) AddCoreFontResource(coreFont *corefont.CoreFont, objects *[]*PDFobj) *Font
- func (page *Page) AddDestination(name *string, xPosition, yPosition float32) *Destination
- func (page *Page) AddEMC()
- func (page *Page) AddFontResource(font *Font, objects *[]*PDFobj)
- func (page *Page) AddFooter(textLine *TextLine) []float32
- func (page *Page) AddFooterOffsetBy(textLine *TextLine, offset float32) []float32
- func (page *Page) AddHeader(textLine *TextLine) []float32
- func (page *Page) AddHeaderOffsetBy(textLine *TextLine, offset float32) []float32
- func (page *Page) AddImageResource(image *Image, objects *[]*PDFobj)
- func (page *Page) AddWatermark(font *Font, text string)
- func (page *Page) BeginText()
- func (page *Page) BezierCurveTo(p1, p2, p3 *Point)
- func (page *Page) ClipPath()
- func (page *Page) ClipRect(x, y, w, h float32)
- func (page *Page) ClosePath()
- func (page *Page) Complete(objects *[]*PDFobj)
- func (page *Page) CurveTo(x1, y1, x2, y2, x3, y3 float32)
- func (page *Page) DrawArrayOfCharacters(font *Font, text string, x, y, dx float32)
- func (page *Page) DrawCircle(x, y, r float32)
- func (page *Page) DrawContents(content []byte, h float32, x float32, y float32, xScale float32, ...)
- func (page *Page) DrawEllipse(x, y, r1, r2 float32)
- func (page *Page) DrawLine(x1, y1, x2, y2 float32)
- func (page *Page) DrawPath(path []*Point, operation string)
- func (page *Page) DrawPoint(p *Point)
- func (page *Page) DrawRect(x, y, w, h float32)
- func (page *Page) DrawRectRoundCorners(x, y, w, h, r1, r2 float32, operation string)
- func (page *Page) DrawString(font1 *Font, font2 *Font, text string, x, y float32)
- func (page *Page) DrawStringUsingColorMap(font, fallbackFont *Font, text string, x, y float32, brush int32, ...)
- func (page *Page) DrawText(str string)
- func (page *Page) EndText()
- func (page *Page) FillCircle(x, y, r float32)
- func (page *Page) FillEllipse(x, y, r1, r2 float32)
- func (page *Page) FillPath()
- func (page *Page) FillRect(x, y, w, h float32)
- func (page *Page) GetBrushColor() [3]float32
- func (page *Page) GetHeight() float32
- func (page *Page) GetPenColor() [3]float32
- func (page *Page) GetWidth() float32
- func (page *Page) InvertYAxis()
- func (page *Page) LineTo(x, y float32)
- func (page *Page) MoveTo(x, y float32)
- func (page *Page) NextLine()
- func (page *Page) Restore()
- func (page *Page) Save()
- func (page *Page) SetArtBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)
- func (page *Page) SetBleedBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)
- func (page *Page) SetBrushColor(color int32)
- func (page *Page) SetBrushColorCMYK(c, m, y, k float32)
- func (page *Page) SetBrushColorRGB(r, g, b float32)
- func (page *Page) SetColorCMYK(c, m, y, k float32)
- func (page *Page) SetColorRGB(r, g, b float32)
- func (page *Page) SetCropBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)
- func (page *Page) SetDefaultLinePattern()
- func (page *Page) SetDefaultLineWidth()
- func (page *Page) SetGraphicsState(gs *GraphicsState)
- func (page *Page) SetLineCapStyle(style int)
- func (page *Page) SetLineJoinStyle(style int)
- func (page *Page) SetLinePattern(pattern string)
- func (page *Page) SetPenColor(color int32)
- func (page *Page) SetPenColorCMYK(c, m, y, k float32)
- func (page *Page) SetPenColorRGB(r, g, b float32)
- func (page *Page) SetPenWidth(width float32)
- func (page *Page) SetTextDirection(degrees int)
- func (page *Page) SetTextFont(font *Font)
- func (page *Page) SetTextLeading(leading float32)
- func (page *Page) SetTextLocation(x, y float32)
- func (page *Page) SetTextRenderingMode(mode int)
- func (page *Page) SetTextRise(rise float32)
- func (page *Page) SetTextScaling(scaling float32)
- func (page *Page) SetTrimBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)
- func (page *Page) StrokePath()
- func (page *Page) Transform(values []float32)
- type Paragraph
- func (paragraph *Paragraph) Add(textLine *TextLine) *Paragraph
- func (paragraph *Paragraph) GetTextLines() []*TextLine
- func (paragraph *Paragraph) GetTextX() float32
- func (paragraph *Paragraph) GetTextY() float32
- func (paragraph *Paragraph) GetX1() float32
- func (paragraph *Paragraph) GetX2() float32
- func (paragraph *Paragraph) GetY1() float32
- func (paragraph *Paragraph) GetY2() float32
- func (paragraph *Paragraph) SetAlignment(alignment int) *Paragraph
- func (paragraph *Paragraph) SetColor(color int32)
- func (paragraph *Paragraph) SetColorMap(colorMap map[string]int32)
- func (paragraph *Paragraph) StartsWith(token string) bool
- type Path
- func (path *Path) Add(point *Point)
- func (path *Path) DrawOn(page *Page) []float32
- func (path *Path) GetLineCapStyle() int
- func (path *Path) GetLineJoinStyle() int
- func (path *Path) PlaceAtZeroZeroIn(box *Box)
- func (path *Path) PlaceIn(box *Box, xOffset, yOffset float32)
- func (path *Path) ScaleBy(factor float32)
- func (path *Path) SetClosePath(closePath bool)
- func (path *Path) SetColor(color int32)
- func (path *Path) SetFillShape(fillShape bool)
- func (path *Path) SetLineCapStyle(style int)
- func (path *Path) SetLineJoinStyle(style int)
- func (path *Path) SetLocation(x, y float32)
- func (path *Path) SetPattern(pattern string)
- func (path *Path) SetWidth(width float32)
- type PathOp
- type Point
- func (point *Point) DrawOn(page *Page) []float32
- func (point *Point) GetAlignment() int
- func (point *Point) GetColor() int32
- func (point *Point) GetFillShape() bool
- func (point *Point) GetLinePattern() string
- func (point *Point) GetLineWidth() float32
- func (point *Point) GetRadius() float32
- func (point *Point) GetShape() int
- func (point *Point) GetText() string
- func (point *Point) GetTextColor() int32
- func (point *Point) GetTextDirection() int
- func (point *Point) GetURIAction() *string
- func (point *Point) GetX() float32
- func (point *Point) GetY() float32
- func (point *Point) PlaceAtZeroZeroIn(box *Box)
- func (point *Point) PlaceIn(box *Box, xOffset, yOffset float32)
- func (point *Point) SetAlignment(align int)
- func (point *Point) SetColor(color int32) *Point
- func (point *Point) SetDrawPath() *Point
- func (point *Point) SetFillShape(fillShape bool)
- func (point *Point) SetLinePattern(linePattern string)
- func (point *Point) SetLineWidth(lineWidth float32) *Point
- func (point *Point) SetLocation(x, y float32)
- func (point *Point) SetRadius(r float32)
- func (point *Point) SetShape(shape int) *Point
- func (point *Point) SetText(text string)
- func (point *Point) SetTextColor(textColor int32)
- func (point *Point) SetTextDirection(textDirection int)
- func (point *Point) SetURIAction(uri *string)
- func (point *Point) SetX(x float32)
- func (point *Point) SetY(y float32)
- type RadioButton
- func (radioButton *RadioButton) DrawOn(page *Page) []float32
- func (radioButton *RadioButton) SelectButton(selected bool) *RadioButton
- func (radioButton *RadioButton) SetActualText(actualText string) *RadioButton
- func (radioButton *RadioButton) SetAltDescription(altDescription string) *RadioButton
- func (radioButton *RadioButton) SetFontSize(fontSize float32) *RadioButton
- func (radioButton *RadioButton) SetLocation(x, y float32) *RadioButton
- func (radioButton *RadioButton) SetURIAction(uri *string) *RadioButton
- type Round
- type SVG
- type SVGImage
- type SVGPath
- type Slice
- type State
- type StructElem
- type Table
- func (table *Table) DrawOn(page *Page) [2]float32
- func (table *Table) DrawOnPages(pdf *PDF, pages *[]*Page, pageSize [2]float32) [2]float32
- func (table *Table) GetCellAt(rowIndex, colIndex int) *Cell
- func (table *Table) GetCellAtRowColumn(rowIndex, colIndex int) *Cell
- func (table *Table) GetColumn(index int) []*Cell
- func (table *Table) GetColumnAtIndex(index int) []*Cell
- func (table *Table) GetColumnWidth(index int) float32
- func (table *Table) GetRow(index int) []*Cell
- func (table *Table) GetRowAtIndex(index int) []*Cell
- func (table *Table) GetRowsRendered() int
- func (table *Table) GetWidth() float32
- func (table *Table) RemoveLineBetweenRows(index1, index2 int)
- func (table *Table) RightAlignNumbers()
- func (table *Table) SetBottomMargin(bottomMargin float32)
- func (table *Table) SetCellBorders(borders bool)
- func (table *Table) SetCellBordersColor(color int32)
- func (table *Table) SetCellBordersWidth(width float32)
- func (table *Table) SetColumnWidth(index int, width float32)
- func (table *Table) SetColumnWidths()
- func (table *Table) SetData(tableData [][]*Cell, numOfHeaderRows int)
- func (table *Table) SetFontInColumn(index int, font *Font)
- func (table *Table) SetFontInRow(index int, font *Font)
- func (table *Table) SetLocation(x, y float32)
- func (table *Table) SetLocationFirstPage(x, y float32)
- func (table *Table) SetTextAlignInColumn(index, alignment int)
- func (table *Table) SetTextColorInColumn(index int, color int32)
- func (table *Table) SetTextColorInRow(index int, color int32)
- func (table *Table) SetVisibleColumns(visible ...int)
- type Text
- func (text *Text) DrawOn(page *Page) [2]float32
- func (text *Text) GetSize() [2]float32
- func (text *Text) SetBorder(border bool)
- func (text *Text) SetLeading(leading float32) *Text
- func (text *Text) SetLocation(x, y float32) *Text
- func (text *Text) SetParagraphLeading(paragraphLeading float32) *Text
- func (text *Text) SetSpaceBetweenTextLines(spaceBetweenTextLines float32) *Text
- func (text *Text) SetWidth(width float32) *Text
- type TextBox
- func (textBox *TextBox) DrawOn(page *Page) [2]float32
- func (textBox *TextBox) DrawText(page *Page, font, fallbackFont *Font, text string, xText float32, ...)
- func (textBox *TextBox) GetBgColor() int32
- func (textBox *TextBox) GetBorder(value int) bool
- func (textBox *TextBox) GetBrushColor() int32
- func (textBox *TextBox) GetFallbackFont() *Font
- func (textBox *TextBox) GetFont() *Font
- func (textBox *TextBox) GetHeight() float32
- func (textBox *TextBox) GetLineWidth() float32
- func (textBox *TextBox) GetLocation() [2]float32
- func (textBox *TextBox) GetMargin() float32
- func (textBox *TextBox) GetPenColor() int32
- func (textBox *TextBox) GetSpacing() float32
- func (textBox *TextBox) GetStrikeout() bool
- func (textBox *TextBox) GetText() string
- func (textBox *TextBox) GetTextAlignment() int
- func (textBox *TextBox) GetTextColors() map[string]int32
- func (textBox *TextBox) GetUnderline() bool
- func (textBox *TextBox) GetVerticalAlignment() int
- func (textBox *TextBox) GetWidth() float32
- func (textBox *TextBox) GetX() float32
- func (textBox *TextBox) GetY() float32
- func (textBox *TextBox) SetBgColor(color int32)
- func (textBox *TextBox) SetBgColorRGB(color []int32)
- func (textBox *TextBox) SetBorder(border int)
- func (textBox *TextBox) SetBorders(borders bool)
- func (textBox *TextBox) SetBrushColor(color int32)
- func (textBox *TextBox) SetBrushColorRGB(color []int32)
- func (textBox *TextBox) SetFallbackFont(font *Font)
- func (textBox *TextBox) SetFgColor(color int32)
- func (textBox *TextBox) SetFgColorRGB(color []int32)
- func (textBox *TextBox) SetFont(font *Font)
- func (textBox *TextBox) SetHeight(height float32)
- func (textBox *TextBox) SetLineWidth(lineWidth float32)
- func (textBox *TextBox) SetLocation(x, y float32)
- func (textBox *TextBox) SetMargin(margin float32)
- func (textBox *TextBox) SetPenColor(color int32)
- func (textBox *TextBox) SetPenColorRGB(color []int32)
- func (textBox *TextBox) SetPosition(x, y float32)
- func (textBox *TextBox) SetSpacing(spacing float32)
- func (textBox *TextBox) SetStrikeout(strikeout bool)
- func (textBox *TextBox) SetText(text string)
- func (textBox *TextBox) SetTextAlignment(alignment int)
- func (textBox *TextBox) SetTextColors(colors map[string]int32)
- func (textBox *TextBox) SetTextDirection(textDirection int)
- func (textBlock *TextBox) SetURIAction(uri string) *TextBox
- func (textBox *TextBox) SetUnderline(underline bool)
- func (textBox *TextBox) SetVerticalAlignment(valign int)
- func (textBox *TextBox) SetWidth(width float32)
- type TextColumn
- func (textColumn *TextColumn) AddChineseParagraph(font *Font, text string)
- func (textColumn *TextColumn) AddJapaneseParagraph(font *Font, text string)
- func (textColumn *TextColumn) AddParagraph(paragraph *Paragraph)
- func (textColumn *TextColumn) DrawOn(page *Page) []float32
- func (textColumn *TextColumn) GetSize() *Dimension
- func (textColumn *TextColumn) RemoveLastParagraph()
- func (textColumn *TextColumn) SetAlignment(alignment int)
- func (textColumn *TextColumn) SetLineBetweenParagraphs(lineBetweenParagraphs bool)
- func (textColumn *TextColumn) SetLineSpacing(spacing float32)
- func (textColumn *TextColumn) SetLocation(x, y float32)
- func (textColumn *TextColumn) SetSize(w, h float32)
- func (textColumn *TextColumn) SetSpaceBetweenLines(spaceBetweenLines float32)
- func (textColumn *TextColumn) SetSpaceBetweenParagraphs(spaceBetweenParagraphs float32)
- func (textColumn *TextColumn) SetWidth(w float32)
- type TextFrame
- func (frame *TextFrame) DrawBorder(page *Page)
- func (frame *TextFrame) DrawOn(page *Page) []float32
- func (frame *TextFrame) GetBeginParagraphPoints() [][]float32
- func (frame *TextFrame) GetParagraphs() []*TextLine
- func (frame *TextFrame) IsNotEmpty() bool
- func (frame *TextFrame) SetDrawBorder(border bool)
- func (frame *TextFrame) SetHeight(h float32) *TextFrame
- func (frame *TextFrame) SetLeading(leading float32) *TextFrame
- func (frame *TextFrame) SetLocation(x, y float32) *TextFrame
- func (frame *TextFrame) SetParagraphLeading(paragraphLeading float32) *TextFrame
- func (frame *TextFrame) SetPosition(x, y float32)
- func (frame *TextFrame) SetSpaceBetweenTextLines(spaceBetweenTextLines float32) *TextFrame
- func (frame *TextFrame) SetWidth(w float32) *TextFrame
- type TextLine
- func (textLine *TextLine) DrawOn(page *Page) []float32
- func (textLine *TextLine) GetActualText() string
- func (textLine *TextLine) GetAltDescription() string
- func (textLine *TextLine) GetColor() int32
- func (textLine *TextLine) GetColorMap() map[string]int32
- func (textLine *TextLine) GetDestinationX() float32
- func (textLine *TextLine) GetDestinationY() float32
- func (textLine *TextLine) GetFallbackFont() *Font
- func (textLine *TextLine) GetFont() *Font
- func (textLine *TextLine) GetGoToAction() *string
- func (textLine *TextLine) GetHeight() float32
- func (textLine *TextLine) GetLanguage() string
- func (textLine *TextLine) GetStrikeout() bool
- func (textLine *TextLine) GetStringWidth(text string) float32
- func (textLine *TextLine) GetText() string
- func (textLine *TextLine) GetTextDirection() int
- func (textLine *TextLine) GetTextEffect() int
- func (textLine *TextLine) GetTrailingSpace() bool
- func (textLine *TextLine) GetURIAction() *string
- func (textLine *TextLine) GetUnderline() bool
- func (textLine *TextLine) GetVerticalOffset() float32
- func (textLine *TextLine) GetWidth() float32
- func (textLine *TextLine) PlaceIn(box *Box, xOffset, yOffset float32) *TextLine
- func (textLine *TextLine) PlaceInAtZeroZero(box *Box) *TextLine
- func (textLine *TextLine) SetActualText(actualText string) *TextLine
- func (textLine *TextLine) SetAltDescription(altDescription string) *TextLine
- func (textLine *TextLine) SetColor(color int32) *TextLine
- func (textLine *TextLine) SetColorMap(colorMap map[string]int32)
- func (textLine *TextLine) SetColorRGB(color []int32) *TextLine
- func (textLine *TextLine) SetFallbackFont(fallbackFont *Font) *TextLine
- func (textLine *TextLine) SetFallbackFontSize(fallbackFontSize float32) *TextLine
- func (textLine *TextLine) SetFont(font *Font) *TextLine
- func (textLine *TextLine) SetFontSize(fontSize float32) *TextLine
- func (textLine *TextLine) SetGoToAction(key *string) *TextLine
- func (textLine *TextLine) SetLanguage(language string) *TextLine
- func (textLine *TextLine) SetLocation(x, y float32) *TextLine
- func (textLine *TextLine) SetStrikeout(strikeout bool) *TextLine
- func (textLine *TextLine) SetStructureType(structureType string) *TextLine
- func (textLine *TextLine) SetText(text string) *TextLine
- func (textLine *TextLine) SetTextDirection(degrees int) *TextLine
- func (textLine *TextLine) SetTextEffect(textEffect int) *TextLine
- func (textLine *TextLine) SetTrailingSpace(trailingSpace bool) *TextLine
- func (textLine *TextLine) SetURIAction(uri *string) *TextLine
- func (textLine *TextLine) SetURIActualText(uriActualText string) *TextLine
- func (textLine *TextLine) SetURIAltDescription(uriAltDescription string) *TextLine
- func (textLine *TextLine) SetURILanguage(uriLanguage string) *TextLine
- func (textLine *TextLine) SetUnderline(underline bool) *TextLine
- func (textLine *TextLine) SetVerticalOffset(verticalOffset float32) *TextLine
- type Title
Constants ¶
const ( Upc = iota CODE128 CODE39 )
Constants
const ( LeftToRight = iota TopToBottom BottomToTop )
Constants
const ( ALPHA = 0x08 LOWER = 0x04 MIXED = 0x02 PUNCT = 0x01 LatchToLower = 27 ShiftToAlpha = 27 LatchToMixed = 28 LatchToAlpha = 28 ShiftToPunct = 29 )
Constants
const ( Courier = iota CourierBold CourierOblique CourierBoldOblique Helvetica HelveticaBold HelveticaOblique HelveticaBoldOblique TimesRoman TimesBold TimesItalic TimesBoldItalic Symbol ZapfDingbats )
Used to select one of the 14 core fonts. See the Font class for more details.
const ( // AdobeMingStdLight is Chinese (Traditional) font AdobeMingStdLight = "AdobeMingStd-Light" // STHeitiSCLight is Chinese (Simplified) font STHeitiSCLight = "STHeitiSC-Light" // KozMinProVIRegular is Japanese font KozMinProVIRegular = "KozMinProVI-Regular" // AdobeMyungjoStdMedium is Korean font AdobeMyungjoStdMedium = "AdobeMyungjoStd-Medium" )
const ( TableWith0HeaderRows = iota TableWith1HeaderRow TableWith2HeaderRows TableWith3HeaderRows TableWith4HeaderRows TableWith5HeaderRows TableWith6HeaderRows TableWith7HeaderRows TableWith8HeaderRows TableWith9HeaderRows )
Constants
Variables ¶
var ICCBlackScaledProfile = []byte{}/* 2577 elements not displayed */
ICCBlackScaledProfile is used in the pdf.go
Functions ¶
func FontStream1 ¶
FontStream1 is used to add stream fonts to the PDF.
func FontStream2 ¶
FontStream2 constructs font object and adds it to the PDF objects slice.
func GetControlPoints ¶
func NewColorMap ¶
Please see: https://www.w3.org/TR/css-color-3/#svg-color
func PrintDuration ¶
func ReadTextLines ¶
func ReorderVisually ¶
ReorderVisually reorders the string so that Arabic and Hebrew text flows from right to left while numbers and Latin text flows from left to right. @param str the input string. @return the reordered string.
func XMarkCheckBox ¶
Types ¶
type Annotation ¶
type Annotation struct {
// contains filtered or unexported fields
}
Annotation is used to create PDF annotation objects.
func NewAnnotation ¶
func NewAnnotation( uri *string, key *string, x1, y1, x2, y2 float32, language string, actualText string, altDescription string) *Annotation
NewAnnotation is the constructor used to create annotation objects.
@param uri the URI string. @param key the destination name. @param x1 the x coordinate of the top left corner. @param y1 the y coordinate of the top left corner. @param x2 the x coordinate of the bottom right corner. @param y2 the y coordinate of the bottom right corner.
type BMPImage ¶
type BMPImage struct {
// contains filtered or unexported fields
}
BMPImage describes BMP image object.
func NewBMPImage ¶
NewBMPImage constructs bitmap image objects.
type Barcode ¶
type Barcode struct {
// contains filtered or unexported fields
}
Barcode describes one dimentional barcodes - UPC, Code 39 and Code 128. Please see Example_11.
func NewBarcode ¶
NewBarcode constructs barcode objects. @param type the type of the barcode. @param str the content string of the barcode.
func (*Barcode) SetBarHeightFactor ¶
SetBarHeightFactor sets the bar height factor. The height of the bars is the moduleLength * barHeightFactor The default value is 50.0f
func (*Barcode) SetDirection ¶
SetDirection sets the drawing direction for this font. @param direction the specified direction.
func (*Barcode) SetFont ¶
SetFont sets the font to be used with this barcode. @param font the specified font.
func (*Barcode) SetLocation ¶
SetLocation sets the location where this barcode will be drawn on the page. @param x1 the x coordinate of the top left corner of the barcode. @param y1 the y coordinate of the top left corner of the barcode.
func (*Barcode) SetModuleLength ¶
SetModuleLength sets the module length of this barcode. The default value is 0.75
type Barcode2D ¶
type Barcode2D struct {
// contains filtered or unexported fields
}
Barcode2D describes PDF417 2D barcodes. Please see Example_12.
func NewBarcode2D ¶
NewBarcode2D constructor for 2D barcodes. @param str the specified string.
func (*Barcode2D) DrawOn ¶
DrawOn draws this barcode on the specified page. @return x and y coordinates of the bottom right corner of this component.
func (*Barcode2D) SetLocation ¶
SetLocation sets the location of this barcode on the page. @param x the x coordinate of the top left corner of the barcode. @param y the y coordinate of the top left corner of the barcode.
func (*Barcode2D) SetModuleWidth ¶
SetModuleWidth sets the module width for this barcode. This changes the barcode size while preserving the aspect. Use value between 0.5 and 0.75 If the value is too small some scanners may have difficulty reading the barcode.
func (*Barcode2D) SetPosition ¶
SetPosition sets the barcode location on the page.
type Bookmark ¶
type Bookmark struct {
// contains filtered or unexported fields
}
Bookmark please see Example_51 and Example_52
func NewBookmarkAt ¶
NewBookmarkAt creates new bookmark at the specified y coordinate.
func (*Bookmark) AddBookmark ¶
AddBookmark adds bookmark to the page.
func (*Bookmark) AutoNumber ¶
AutoNumber auto numbers the bookmark.
func (*Bookmark) GetDestKey ¶
GetDestKey returns the destination key.
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box is used to create rectangular boxes on a page. Also used to for layout purposes. See the placeIn method in the Image and TextLine classes.
func NewBoxAt ¶
NewBoxAt creates a box object. @param x the x coordinate of the top left corner of this box when drawn on the page. @param y the y coordinate of the top left corner of this box when drawn on the page. @param w the width of this box. @param h the height of this box.
func (*Box) DrawOn ¶
DrawOn draws this box on the specified page. @param page the page to draw this box on. @return x and y coordinates of the bottom right corner of this component.
func (*Box) PlaceIn ¶
PlaceIn places this box in the another box. @param box the other box. @param xOffset the x offset from the top left corner of the box. @param yOffset the y offset from the top left corner of the box.
func (*Box) ScaleBy ¶
ScaleBy scales this box by the spacified factor. @param factor the factor used to scale the box.
func (*Box) SetActualText ¶
SetActualText sets the actual text for this box. @param actualText the actual text for the box. @return this Box.
func (*Box) SetAltDescription ¶
SetAltDescription sets the alternate description of this box. @param altDescription the alternate description of the box. @return this Box.
func (*Box) SetColor ¶
SetColor sets the color for this box. @param color the color specified as an integer.
func (*Box) SetFillShape ¶
SetFillShape sets the private fillShape variable. If the value of fillShape is true - the box is filled with the current brush color. @param fillShape the value used to set the private fillShape variable.
func (*Box) SetGoToAction ¶
SetGoToAction sets the destination key for the action. @param key the destination name.
func (*Box) SetLineWidth ¶
SetLineWidth sets the width of this line. @param width the width.
func (*Box) SetLocation ¶
SetLocation sets the location of this box on the page. @param x the x coordinate of the top left corner of this box when drawn on the page. @param y the y coordinate of the top left corner of this box when drawn on the page.
func (*Box) SetPattern ¶
SetPattern sets the line dash pattern that controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units. <pre> Examples of line dash patterns:
"[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
</pre>
@param pattern the line dash pattern.
func (*Box) SetSize ¶
SetSize sets the size of this box. @param w the width of this box. @param h the height of this box.
func (*Box) SetStructureType ¶
SetStructureType sets the type of the structure.
func (*Box) SetURIAction ¶
SetURIAction sets the URI for the "click box" action. @param uri the URI
type CalendarMonth ¶
type CalendarMonth struct {
// contains filtered or unexported fields
}
CalendarMonth describes calendar month object.
func (*CalendarMonth) DrawOn ¶
func (calendarMonth *CalendarMonth) DrawOn(page *Page)
DrawOn draws the calendar month on the page.
func (*CalendarMonth) NewCalendarMonth ¶
func (calendarMonth *CalendarMonth) NewCalendarMonth(f1, f2 *Font, year, month int)
NewCalendarMonth constructs new calendar month object.
func (*CalendarMonth) SetBodyFont ¶
func (calendarMonth *CalendarMonth) SetBodyFont(font *Font)
func (*CalendarMonth) SetCellHeight ¶
func (calendarMonth *CalendarMonth) SetCellHeight(height float32)
func (*CalendarMonth) SetCellWidth ¶
func (calendarMonth *CalendarMonth) SetCellWidth(width float32)
func (*CalendarMonth) SetHeadFont ¶
func (calendarMonth *CalendarMonth) SetHeadFont(font *Font)
func (*CalendarMonth) SetLocation ¶
func (calendarMonth *CalendarMonth) SetLocation(x, y float32)
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is used to create table cell objects. See the Table class for more information.
func NewCell ¶
NewCell creates a cell object and sets the font and the cell text. @param font the font. @param text the text.
func NewEmptyCell ¶
NewEmptyCell creates a cell object and sets the font. @param font the font.
func (*Cell) GetBgColor ¶
GetBgColor returns the background color of this cell.
func (*Cell) GetBrushColor ¶
GetBrushColor returns the brush color. @return the brush color.
func (*Cell) GetColSpan ¶
GetColSpan returns the column span func (cell *Cell) variable value. @return the column span value.
func (*Cell) GetCompositeTextLine ¶
func (cell *Cell) GetCompositeTextLine() *CompositeTextLine
GetCompositeTextLine returns the composite text object. @return the composite text object.
func (*Cell) GetFallbackFont ¶
GetFallbackFont returns the fallback font used by this cell. @return the fallback font.
func (*Cell) GetLineWidth ¶
GetLineWidth returns the border line width.
func (*Cell) GetProperties ¶
GetProperties returns the properties.
func (*Cell) GetStrikeout ¶
GetStrikeout returns the strikeout text parameter. @return the strikeout text parameter.
func (*Cell) GetTextAlignment ¶
GetTextAlignment returns the text alignment. @return the text horizontal alignment code.
func (*Cell) GetTextBox ¶
GetTextBox returns the cell's text box.
func (*Cell) GetUnderline ¶
GetUnderline returns the underline text parameter. @return the underline text parameter.
func (*Cell) GetVerTextAlignment ¶
GetVerTextAlignment returns the cell text vertical alignment. @return the vertical alignment code.
func (*Cell) SetBgColor ¶
SetBgColor sets the background to the specified color. @param color the color specified as 0xRRGGBB integer.
func (*Cell) SetBorders ¶
SetBorders sets all cell borders to true or false.
func (*Cell) SetBottomPadding ¶
SetBottomPadding sets the bottom padding of this cell. @param padding the bottom padding.
func (*Cell) SetBrushColor ¶
SetBrushColor sets the brush color. @param color the color specified as 0xRRGGBB integer.
func (*Cell) SetColSpan ¶
SetColSpan sets the column span func (cell *Cell) variable. @param colspan the specified column span value.
func (*Cell) SetCompositeTextLine ¶
func (cell *Cell) SetCompositeTextLine(compositeTextLine *CompositeTextLine)
SetCompositeTextLine sets the composite text object. @param compositeTextLine the composite text object.
func (*Cell) SetFallbackFont ¶
SetFallbackFont sets the fallback font for this cell. @param fallbackFont the fallback font.
func (*Cell) SetFgColor ¶
SetFgColor sets the pen and brush colors to the specified color. @param color the color specified as 0xRRGGBB integer.
func (*Cell) SetLeftPadding ¶
SetLeftPadding sets the left padding of this cell. @param padding the left padding.
func (*Cell) SetLineWidth ¶
SetLineWidth sets the border line width.
func (*Cell) SetPadding ¶
SetPadding sets the top, bottom, left and right paddings of this cell. @param padding the right padding.
func (*Cell) SetPenColor ¶
SetPenColor sets the pen color. @param color the color specified as 0xRRGGBB integer.
func (*Cell) SetPoint ¶
SetPoint sets the point inside this cell. See the Point class and Example_09 for more information.
func (*Cell) SetProperties ¶
SetProperties sets the properties.
func (*Cell) SetRightPadding ¶
SetRightPadding sets the right padding of this cell. @param padding the right padding.
func (*Cell) SetStrikeout ¶
SetStrikeout sets the strikeout text parameter. @param strikeout the strikeout text parameter.
func (*Cell) SetTextAlignment ¶
SetTextAlignment sets the cell text alignment. @param alignment the alignment code. Supported values: align.Left, align.Right and align.Center
func (*Cell) SetTextBox ¶
SetTextBox sets the composite text object. @param compositeTextLine the composite text object.
func (*Cell) SetTopPadding ¶
SetTopPadding sets the top padding of this cell. @param padding the top padding.
func (*Cell) SetURIAction ¶
SetURIAction sets the URI action.
func (*Cell) SetUnderline ¶
SetUnderline sets the underline text parameter. If the value of the underline variable is 'true' - the text is underlined. @param underline the underline text parameter.
func (*Cell) SetVerTextAlignment ¶
SetVerTextAlignment sets the cell text vertical alignment. @param alignment the alignment code. Supported values: align.Top, align.Center and align.Bottom
func (*Cell) StrikeoutText ¶
StrikeoutText strikes out the cell text.
type Chart ¶
type Chart struct {
// contains filtered or unexported fields
}
Chart is used to create XY chart objects and draw them on a page. Please see Example_09.
func NewChart ¶
NewChart creates XY chart objects. @param f1 the font used for the chart title. @param f2 the font used for the X and Y axis titles.
func (*Chart) DrawOn ¶
DrawOn draws chart chart on the specified page. @param page the page to draw chart chart on.
func (*Chart) DrawXAxisLabels ¶
DrawXAxisLabels draws the X axis labels.
func (*Chart) DrawYAxisLabels ¶
DrawYAxisLabels draws the Y axis labels.
func (*Chart) Intercept ¶
Intercept calculates the intercept of a trend line given a list of points. See Example_09.
func (*Chart) SetDrawXAxisLabels ¶
SetDrawXAxisLabels -- TODO:
func (*Chart) SetDrawXAxisLines ¶
SetDrawXAxisLines -- TODO:
func (*Chart) SetDrawYAxisLabels ¶
SetDrawYAxisLabels -- TODO:
func (*Chart) SetDrawYAxisLines ¶
SetDrawYAxisLines -- TODO:
func (*Chart) SetLocation ¶
SetLocation sets the location of chart chart on the page.
func (*Chart) SetMaximumFractionDigits ¶
SetMaximumFractionDigits sets the maximum number of fractions digits do display for the X and Y axis labels.
func (*Chart) SetMinimumFractionDigits ¶
SetMinimumFractionDigits sets the minimum number of fractions digits do display for the X and Y axis labels.
func (*Chart) SetXAxisMinMax ¶
SetXAxisMinMax sets xMin and xMax for the X axis and the number of X grid lines.
func (*Chart) SetXAxisTitle ¶
SetXAxisTitle sets the title for the X axis.
func (*Chart) SetYAxisMinMax ¶
SetYAxisMinMax sets yMin and yMax for the Y axis and the number of Y grid lines.
func (*Chart) SetYAxisTitle ¶
SetYAxisTitle sets the title for the Y axis.
type CheckBox ¶
type CheckBox struct {
// contains filtered or unexported fields
}
CheckBox creates a CheckBox, which can be set checked or unchecked. By default the check box is unchecked.
func NewCheckBox ¶
NewCheckBox creates a CheckBox with black check mark.
func (*CheckBox) Check ¶
*
- Checks or unchecks checkBox check box. See the Mark class for available options. *
- @return checkBox CheckBox.
func (*CheckBox) DrawOn ¶
DrawOn draws checkBox CheckBox on the specified Page.
@param page the Page where the CheckBox is to be drawn.
func (*CheckBox) SetActualText ¶
SetActualText sets the actual text for checkBox check box. @param actualText the actual text for the check box. @return checkBox CheckBox.
func (*CheckBox) SetAltDescription ¶
SetAltDescription sets the alternate description of checkBox check box. @param altDescription the alternate description of the check box. @return checkBox Checkbox.
func (*CheckBox) SetBoxColor ¶
SetBoxColor sets the color of the check box. @param boxColor the check box color specified as an 0xRRGGBB integer. @return checkBox CheckBox.
func (*CheckBox) SetCheckmark ¶
SetCheckmark sets the color of the check mark. @param checkColor the check mark color specified as an 0xRRGGBB integer. @return checkBox CheckBox.
func (*CheckBox) SetFontSize ¶
SetFontSize sets the font size to use for checkBox text line. @param fontSize the fontSize to use. @return checkBox CheckBox.
func (*CheckBox) SetLocation ¶
SetLocation sets the x,y location on the Page. @param x the x coordinate on the Page. @param y the y coordinate on the Page. @return checkBox CheckBox.
func (*CheckBox) SetURIAction ¶
SetURIAction sets the URI for the "click text line" action. @param uri the URI. @return checkBox CheckBox.
type CompositeTextLine ¶
CompositeTextLine constructs composite text line objects. This class was designed and implemented by Jon T. Swanson, Ph.D. Refactored and integrated into the project by Eugene Dragoev - 1st of June 2020.
func NewCompositeTextLine ¶
func NewCompositeTextLine(x, y float32) *CompositeTextLine
NewCompositeTextLine constructs new composite text line object.
func (*CompositeTextLine) AddComponent ¶
func (composite *CompositeTextLine) AddComponent(textLine *TextLine)
AddComponent adds a new text line. Find the current font, current size and effects (normal, super or subscript) Set the position of the component to the starting stored as current position Set the size and offset based on effects Set the new current position @param component the component.
func (*CompositeTextLine) DrawOn ¶
func (composite *CompositeTextLine) DrawOn(page *Page) []float32
DrawOn draws this line on the specified page. @param page the page to draw this line on. @return x and y coordinates of the bottom right corner of this component. @throws Exception
func (*CompositeTextLine) GetFontSize ¶
func (composite *CompositeTextLine) GetFontSize() float32
GetFontSize gets the font size.
func (*CompositeTextLine) GetHeight ¶
func (composite *CompositeTextLine) GetHeight() float32
GetHeight returns the height of this CompositeTextLine.
func (*CompositeTextLine) GetMinMax ¶
func (composite *CompositeTextLine) GetMinMax() []float32
GetMinMax returns the vertical coordinates of the top left and bottom right corners of the bounding box of this composite text line. @return the an array containing the vertical coordinates.
func (*CompositeTextLine) GetNumberOfTextLines ¶
func (composite *CompositeTextLine) GetNumberOfTextLines() int
GetNumberOfTextLines returns the number of text lines.
func (*CompositeTextLine) GetPosition ¶
func (composite *CompositeTextLine) GetPosition() [2]float32
GetPosition return the position of this composite text line.
func (*CompositeTextLine) GetSubscriptFactor ¶
func (composite *CompositeTextLine) GetSubscriptFactor() float32
GetSubscriptFactor gets the subscript factor for this text line. @return subscript the subscript size factor.
func (*CompositeTextLine) GetSubscriptPosition ¶
func (composite *CompositeTextLine) GetSubscriptPosition() float32
GetSubscriptPosition gets the subscript position for this text line. @return subscriptPosition the subscript position.
func (*CompositeTextLine) GetSuperscriptFactor ¶
func (composite *CompositeTextLine) GetSuperscriptFactor() float32
GetSuperscriptFactor gets the superscript factor for this text line. @return superscript the superscript size factor.
func (*CompositeTextLine) GetSuperscriptPosition ¶
func (composite *CompositeTextLine) GetSuperscriptPosition() float32
GetSuperscriptPosition gets the superscript position for this text line.
func (*CompositeTextLine) GetTextLine ¶
func (composite *CompositeTextLine) GetTextLine(index int) *TextLine
GetTextLine return the nth entry in the TextLine array. @param index the index of the nth element.
func (*CompositeTextLine) GetWidth ¶
func (composite *CompositeTextLine) GetWidth() float32
GetWidth returns the width of this CompositeTextLine.
func (*CompositeTextLine) SetFontSize ¶
func (composite *CompositeTextLine) SetFontSize(fontSize float32)
SetFontSize sets the font size.
func (*CompositeTextLine) SetLocation ¶
func (composite *CompositeTextLine) SetLocation(x, y float32)
SetLocation loops through all the text lines and reset their location based on the new location set here. @param x the x coordinate. @param y the y coordinate.
func (*CompositeTextLine) SetSubscriptPosition ¶
func (composite *CompositeTextLine) SetSubscriptPosition(subscriptPosition float32)
SetSubscriptPosition sets the subscript position for this composite text line. @param subscriptPosition the subscript position.
func (*CompositeTextLine) SetSuperscriptFactor ¶
func (composite *CompositeTextLine) SetSuperscriptFactor(superscript float32)
SetSuperscriptFactor sets the superscript factor for this composite text line. @param superscript the superscript size factor.
func (*CompositeTextLine) SetSuperscriptPosition ¶
func (composite *CompositeTextLine) SetSuperscriptPosition(superscriptPosition float32)
SetSuperscriptPosition sets the superscript position for this composite text line. @param superscriptPosition the superscript position.
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination is used to create PDF destination objects.
func NewDestination ¶
func NewDestination(name *string, xPosition float32, yPosition float32) *Destination
NewDestination creates new destination objects.
@param name the name of this destination object. @param xPosition the x coordinate of the top left corner. @param yPosition the y coordinate of the top left corner.
func NewDestination7 ¶
func NewDestination7(name *string, yPosition float32) *Destination
NewDestination creates new destination objects.
@param name the name of this destination object. @param yPosition the y coordinate of the top left corner.
func (*Destination) SetPageObjNumber ¶
func (destination *Destination) SetPageObjNumber(pageObjNumber int)
SetPageObjNumber sets the page object number.
type Dimension ¶
type Dimension struct {
// contains filtered or unexported fields
}
Dimension encapsulates the width and height of a component.
func NewDimension ¶
NewDimension Constructor for creating dimension objects.
@param width the width. @param height the height.
type DonutChart ¶
type DonutChart struct {
// contains filtered or unexported fields
}
DonutChart is used for donut chart objects.
func (*DonutChart) AddSlice ¶
func (chart *DonutChart) AddSlice(slice *Slice)
func (*DonutChart) DrawOn ¶
func (chart *DonutChart) DrawOn(page *Page)
DrawOn draws donut chart on the specified page.
func (*DonutChart) SetLocation ¶
func (chart *DonutChart) SetLocation(xc, yc float32) *DonutChart
SetLocation sets the chart location.
func (*DonutChart) SetR1AndR2 ¶
func (chart *DonutChart) SetR1AndR2(r1, r2 float32) *DonutChart
SetR1AndR2 sets the inner r1 and the outer r2 radius of the donut.
type Drawable ¶
type Drawable interface { // Draws the component implementing this interface on the PDF page. // @param page the page to draw on. // @return x and y coordinates of the bottom right corner of this component. SetPosition(x, y float32) DrawOn(page *Page) [2]float32 }
Drawable is interface that is required for components that can be drawn on a PDF page as part of Optional Content Group. @author Mark Paxton, Eugene Dragoev
type EmbeddedFile ¶
type EmbeddedFile struct {
// contains filtered or unexported fields
}
EmbeddedFile is used to embed file objects in the PDF. The file objects must added to the PDF before drawing on the first page.
func NewEmbeddedFile ¶
NewEmbeddedFile is the constructor.
func NewEmbeddedFileAtPath ¶
func NewEmbeddedFileAtPath(pdf *PDF, filePath string, compress bool) *EmbeddedFile
func (*EmbeddedFile) GetFileName ¶
func (file *EmbeddedFile) GetFileName() string
GetFileName returns the file name.
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field describes field object that is used from the Form class. Please see Example_45
func (*Field) SetActualText ¶
SetActualText sets the alt description.
func (*Field) SetAltDescription ¶
SetAltDescription sets the alt description.
type FileAttachment ¶
type FileAttachment struct {
// contains filtered or unexported fields
}
FileAttachment describes file attachment object.
func NewFileAttachment ¶
func NewFileAttachment(pdf *PDF, embeddedFile *EmbeddedFile) *FileAttachment
NewFileAttachment constructs file attachment objects.
func (*FileAttachment) DrawOn ¶
func (attachment *FileAttachment) DrawOn(page *Page) [2]float32
DrawOn draws this component on the page.
func (*FileAttachment) SetDescription ¶
func (attachment *FileAttachment) SetDescription(description string)
SetDescription sets the description.
func (*FileAttachment) SetIconPaperclip ¶
func (attachment *FileAttachment) SetIconPaperclip()
SetIconPaperclip sets the paper clip icon.
func (*FileAttachment) SetIconPushPin ¶
func (attachment *FileAttachment) SetIconPushPin()
SetIconPushPin sets the push pin icon.
func (*FileAttachment) SetIconSize ¶
func (attachment *FileAttachment) SetIconSize(height float32)
SetIconSize sets the icon size.
func (*FileAttachment) SetLocation ¶
func (attachment *FileAttachment) SetLocation(x, y float32)
SetLocation sets the location.
func (*FileAttachment) SetTitle ¶
func (attachment *FileAttachment) SetTitle(title string)
SetTitle sets the title.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font is used to create font objects. The font objects must added to the PDF before they can be used to draw text.
func NewCJKFont ¶
NewCJKFont is the constructor for CJK - Chinese, Japanese and Korean fonts. Please see Example_04.
@param pdf the PDF to add this font to. @param fontName the font name. Please see Example_04.
func NewCoreFont ¶
NewCoreFont is the constructor for the 14 standard fonts. Creates a font object and adds it to the PDF.
<pre> Examples:
Font font1 = new Font(pdf, CoreFont.HELVETICA) Font font2 = new Font(pdf, CoreFont.TIMES_ITALIC) Font font3 = new Font(pdf, CoreFont.ZAPF_DINGBATS) ...
</pre>
@param pdf the PDF to add this font to. @param coreFont the core font. Must be one the names defined in the CoreFont class.
font := CoreFont(pdf, corefont.Helvetica())
func NewCoreFontForPDFobj ¶
NewCoreFontForPDFobj is the constructor used by PDFobj Core font should be interface!
func NewFontFromFile ¶
func NewFontStream1 ¶
NewFontStream1 constructs font object from .ttf.stream and add it to the PDF
func NewFontStream2 ¶
NewFontStream2 constructs font object from .ttf.stream and add it to the array of PDFobj
func (*Font) GetBodyHeight ¶
GetBodyHeight returns the height of the body of the font.
func (*Font) GetDescent ¶
GetDescent returns the descent of this font.
func (*Font) GetFitChars ¶
GetFitChars returns the number of characters from the specified text string that will fit within the specified width.
func (*Font) SetItalic ¶
SetItalic sets the skew15 private variable. When the variable is set to 'true' all glyphs in the font are skewed on 15 degrees. This makes a regular font look like an italic type font. Use this method when you don't have real italic font in the font family, or when you want to generate smaller PDF files. For example you could embed only the Regular and Bold fonts and synthesize the RegularItalic and BoldItalic.
func (*Font) SetKernPairs ¶
SetKernPairs sets the kerning for the selected font to 'true' or 'false' depending on the passed value of kernPairs parameter. The kerning is implemented only for the 14 standard fonts.
type FontTable ¶
type FontTable struct {
// contains filtered or unexported fields
}
FontTable is used to construct font table objects.
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
Form describes form object. Please see Example_45
func (*Form) DrawOn ¶
DrawOn draws form Form on the specified page. @param page the page to draw form form on. @return x and y coordinates of the bottom right corner of form component.
func (*Form) SetLabelColor ¶
SetLabelColor sets the color for the label.
func (*Form) SetLabelFont ¶
SetLabelFont sets the font for the label text.
func (*Form) SetLabelFontSize ¶
SetLabelFontSize sets the font size for the label text.
func (*Form) SetLocation ¶
SetLocation sets location x and y.
func (*Form) SetRowHeight ¶
SetRowHeight sets the height of the rows.
func (*Form) SetRowWidth ¶
SetRowWidth sets the row width.
func (*Form) SetValueColor ¶
SetValueColor sets the color for the value string.
func (*Form) SetValueFont ¶
SetValueFont sets the font for the value text.
func (*Form) SetValueFontSize ¶
SetValueFontSize sets the font size for falue value text.
type GraphicsState ¶
type GraphicsState struct {
// contains filtered or unexported fields
}
GraphicsState is used to create graphics state objects.
func (*GraphicsState) GetAlphaNonStroking ¶
func (state *GraphicsState) GetAlphaNonStroking() float32
GetAlphaNonStroking returns the non stroking alpha.
func (*GraphicsState) GetAlphaStroking ¶
func (state *GraphicsState) GetAlphaStroking() float32
GetAlphaStroking returns the stroking alpha.
func (*GraphicsState) SetAlphaNonStroking ¶
func (state *GraphicsState) SetAlphaNonStroking(nonStrokingAlpha float32)
SetAlphaNonStroking sets the non stroking alpha.
func (*GraphicsState) SetAlphaStroking ¶
func (state *GraphicsState) SetAlphaStroking(strokingAlpha float32)
SetAlphaStroking sets the stroking alpha.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image describes an image object. The image type can be one of the following:
imagetype.JPG, imagetype.PNG, imagetype.BMP or imagetype.PNG_STREAM
Please see Example_03 and Example_24.
func NewImage ¶
NewImage the main constructor for the Image class. @param pdf the PDF to which we add this image. @param inputStream the input stream to read the image from. @param imageType ImageType.JPG, ImageType.PNG and ImageType.BMP.
func NewImage2 ¶
NewImage2 adds this image to the existing PDF objects. @param objects the map to which we add this image. @param inputStream the input stream to read the image from. @param imageType ImageType.JPG, ImageType.PNG and ImageType.BMP.
func NewImageFromFile ¶
func NewImageFromPDFobj ¶
NewImageFromPDFobj constructs new image from an existing PDF object.
func (*Image) DrawOn ¶
DrawOn draws this image on the specified page. @param page the page to draw this image on. @return x and y coordinates of the bottom right corner of this component.
func (*Image) FlipUpsideDown ¶
FlipUpsideDown flips the image upside down.
func (*Image) GetHeight ¶
GetHeight returns the height of this image when drawn on the page. The scaling is taken into account. @return h - the height of this image.
func (*Image) GetWidth ¶
GetWidth returns the width of this image when drawn on the page. The scaling is taken into account. @return w - the width of this image.
func (*Image) PlaceIn ¶
PlaceIn places this image in the specified box. @param box the specified box.
func (*Image) ResizeHeight ¶
ResizeHeight resizes the image to the specified height.
func (*Image) ResizeToFit ¶
ResizeToFit resizes an image so it would fit on a page.
func (*Image) ResizeWidth ¶
ResizeWidth resizes the image to the specified width.
func (*Image) RotateClockwise ¶
SetRotate sets the image rotation to the specified number of degrees. @param degrees the number of degrees.
func (*Image) ScaleBy ¶
ScaleBy scales this image by the specified factor. @param factor the factor used to scale the image.
func (*Image) ScaleByWidthAndHeight ¶
ScaleByWidthAndHeight scales this image by the specified width and height factor. <p><i>Author:</i> <strong>Pieter Libin</strong>, pieter@emweb.be</p>
@param widthFactor the factor used to scale the width of the image @param heightFactor the factor used to scale the height of the image
func (*Image) SetActualText ¶
SetActualText sets the actual text for this image. @param actualText the actual text for the image. @return this Image.
func (*Image) SetAltDescription ¶
SetAltDescription sets the alternate description of this image. @param altDescription the alternate description of the image. @return this Image.
func (*Image) SetGoToAction ¶
SetGoToAction sets the destination key for the action. @param key the destination name.
func (*Image) SetLocation ¶
SetLocation sets the location of this image on the page to (x, y).
@param x the x coordinate of the top left corner of the image. @param y the y coordinate of the top left corner of the image.
func (*Image) SetPosition ¶
SetPosition sets the location of this image on the page to (x, y).
@param x the x coordinate of the top left corner of the image. @param y the y coordinate of the top left corner of the image.
func (*Image) SetURIAction ¶
SetURIAction sets the URI for the "click box" action. @param uri the URI
type JPGImage ¶
type JPGImage struct {
// contains filtered or unexported fields
}
JPGImage describes JPG image object.
func (*JPGImage) GetColorComponents ¶
GetColorComponents returns the color components of the image.
func (*JPGImage) GetFileSize ¶
GetFileSize returns the file size of the image.
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line is used to create line objects. Please see Example_01 and Example_02
func NewLine ¶
NewLine is the contructor used to create a line objects.
@param x1 the x coordinate of the start point. @param y1 the y coordinate of the start point. @param x2 the x coordinate of the end point. @param y2 the y coordinate of the end point.
func (*Line) DrawOn ¶
DrawOn draws this line on the specified page.
@param page the page to draw this line on. @return x and y coordinates of the bottom right corner of this component. @throws Exception
func (*Line) GetCapStyle ¶
GetCapStyle returns the line cap style. @return the cap style.
func (*Line) GetEndPoint ¶
GetEndPoint returns the end point of this line. @return Point the point.
func (*Line) GetStartPoint ¶
GetStartPoint returns the start point of this line. @return Point the point.
func (*Line) PlaceIn ¶
PlaceIn places this line in the specified box. @param box the specified box. @param xOffset the x offset from the top left corner of the box. @param yOffset the y offset from the top left corner of the box. @return this Line object.
func (*Line) PlaceInBox ¶
PlaceInBox places this line in the specified box at position (0.0f, 0.0f).
@param box the specified box. @return this Line object.
func (*Line) ScaleBy ¶
ScaleBy scales this line by the spacified factor.
@param factor the factor used to scale the line. @return this Line object.
func (*Line) SetActualText ¶
SetActualText sets the actual text for this line. @param actualText the actual text for the line. @return this Line.
func (*Line) SetAltDescription ¶
SetAltDescription sets the alternate description of this line.
@param altDescription the alternate description of the line. @return this Line.
func (*Line) SetCapStyle ¶
SetCapStyle sets the line cap style. @param style the cap style of the current line. Supported values: Cap.BUTT, Cap.ROUND and Cap.PROJECTING_SQUARE @return this Line object.
func (*Line) SetColor ¶
SetColor sets the color for this line. @param color the color specified as an integer. @return this Line object.
func (*Line) SetEndPoint ¶
SetEndPoint sets the x and y coordinates of the end point. @param x the x coordinate of the end point. @param y the t coordinate of the end point. @return this Line object.
func (*Line) SetPattern ¶
SetPattern sets the line dash pattern that controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units. <pre> Examples of line dash patterns:
"[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ... </pre> @param pattern the line dash pattern. @return this Line object.
func (*Line) SetPointA ¶
SetPointA sets the x and y coordinates of the start point. @param x the x coordinate of the start point. @param y the y coordinate of the start point. @return this Line object.
func (*Line) SetPointB ¶
SetPointB sets the x and y coordinates of the end point. @param x the x coordinate of the end point. @param y the t coordinate of the end point. @return this Line object.
func (*Line) SetPosition ¶
SetPosition sets the start point of this line.
func (*Line) SetStartPoint ¶
SetStartPoint sets the x and y coordinates of the start point. @param x the x coordinate of the start point. @param y the y coordinate of the start point. @return this Line object.
type OTF ¶
type OTF struct {
// contains filtered or unexported fields
}
OTF is used to construct TTF and OTF font objects.
type OptionalContentGroup ¶
type OptionalContentGroup struct {
// contains filtered or unexported fields
}
OptionalContentGroup is container for drawable objects that can be drawn on a page as part of Optional Content Group. Please see the PDF specification and Example_30 for more details.
@author Mark Paxton
func NewOptionalContentGroup ¶
func NewOptionalContentGroup(name string) *OptionalContentGroup
NewOptionalContentGroup constructs optional content group.
func (*OptionalContentGroup) Add ¶
func (ocg *OptionalContentGroup) Add(drawable Drawable)
Add appends drawable component to this optional content group.
func (*OptionalContentGroup) DrawOn ¶
func (ocg *OptionalContentGroup) DrawOn(page *Page)
DrawOn draws the components in the optional contect group on the page.
func (*OptionalContentGroup) SetExportable ¶
func (ocg *OptionalContentGroup) SetExportable(exportable bool)
SetExportable sets the exportable components.
func (*OptionalContentGroup) SetPrintable ¶
func (ocg *OptionalContentGroup) SetPrintable(printable bool)
SetPrintable sets the printable components.
func (*OptionalContentGroup) SetVisible ¶
func (ocg *OptionalContentGroup) SetVisible(visible bool)
SetVisible sets the visibility of the group.
type PDF ¶
type PDF struct {
// contains filtered or unexported fields
}
PDF is used to create PDF objects.
func NewPDF ¶
NewPDF the constructor. Here is the layout of the PDF document:
Metadata Object Output Intent Object Fonts Images Resources Object Content1 Content2 ... ContentN Annot1 Annot2 ... AnnotN Page1 Page2 ... PageN Pages StructElem1 StructElem2 ... StructElemN StructTreeRoot Info Root xref table Trailer *
- Creates a PDF object that represents a PDF document.
- Use this constructor to create PDF/A compliant PDF documents.
- Please note: PDF/A compliance requires all fonts to be embedded in the PDF. *
- @param os the associated output stream.
- @param compliance must be: compliance.PDF_UA or compliance.PDF_A_1A to compliance.PDF_A_3B
func NewPDFFile ¶
func (*PDF) AddObjects ¶
AddObjects adds the specified objects to the PDF.
func (*PDF) AddResourceObjects ¶
AddResourceObjects adds the resource objects to the PDF.
func (*PDF) Complete ¶
func (pdf *PDF) Complete()
Complete writes the PDF to the bufio.Writer and calls the Flush method.
func (*PDF) GetPageObjects ¶
GetPageObjects returns all page objects.
func (*PDF) Read ¶
Read returns a list of objects of type PDFobj read from input stream. @param inputStream the PDF input stream. @return List<PDFobj> the list of PDF objects.
func (*PDF) SetCompliance ¶
func (*PDF) SetCreator ¶
SetCreator sets the creator field of the PDF.
func (*PDF) SetKeywords ¶
SetKeywords sets the keywords.
func (*PDF) SetLanguage ¶
SetLanguage sets the "Language" document property of the PDF file.
func (*PDF) SetPageLayout ¶
SetPageLayout sets the page layout.
func (*PDF) SetPageMode ¶
SetPageMode sets the page mode.
func (*PDF) SetSubject ¶
SetSubject sets the "Subject" document property of the PDF file.
type PDFobj ¶
type PDFobj struct {
// contains filtered or unexported fields
}
PDFobj is used to create Java or .NET objects that represent the objects in PDF document. See the PDF specification for more information.
func NewPDFobj ¶
func NewPDFobj() *PDFobj
NewPDFobj is used to create Java or .NET objects that represent the objects in PDF document. See the PDF specification for more information. Also see Example_19.
func (*PDFobj) AddFontResource ¶
AddFontResource adds font resource.
func (*PDFobj) AddImageResource ¶
AddImageResource adds an image resource.
func (*PDFobj) GetContentsObject ¶
GetContentsObject returns the contect object.
func (*PDFobj) GetObjectNumbers ¶
GetObjectNumbers returns the object numbers.
func (*PDFobj) GetPageSize ¶
GetPageSize returns the page size.
func (*PDFobj) SetGraphicsState ¶
func (obj *PDFobj) SetGraphicsState(gs *GraphicsState, objects *[]*PDFobj)
SetGraphicsState sets the graphics state.
func (*PDFobj) SetStreamAndData ¶
SetStreamAndData sets the object stream.
type PNGImage ¶
type PNGImage struct {
// contains filtered or unexported fields
}
PNGImage is used to embed PNG images in the PDF document. <p> <strong>Please note:</strong> <p>
Interlaced images are not supported.
<p>
To convert interlaced image to non-interlaced image use OptiPNG:
<p>
optipng -i0 -o7 myimage.png
func NewPNGImage ¶
NewPNGImage is used to embed PNG images in a PDF document.
func (*PNGImage) GetBitDepth ¶
GetBitDepth returns the bit depth of the image.
func (*PNGImage) GetColorType ¶
GetColorType returns the color type of the image.
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
Page is used to create PDF page objects.
Please note: <pre>
The coordinate (0.0, 0.0) is the top left corner of the page. The size of the pages are represented in points. 1 point is 1/72 inches.
</pre>
func NewPage ¶
*
- Creates page object and add it to the PDF document. *
- Please note:
- <pre>
- The coordinate (0.0, 0.0) is the top left corner of the page.
- The size of the pages are represented in points.
- 1 point is 1/72 inches.
- </pre> *
- @param pdf the pdf object.
- @param pageSize the page size of this page.
func NewPageDetached ¶
func NewPageFromObject ¶
NewPageFromObject creates page object from PDFobj.
func (*Page) AddAnnotation ¶
func (page *Page) AddAnnotation(annotation *Annotation)
AddAnnotation adds annotation to the page.
func (*Page) AddArtifactBMC ¶
func (page *Page) AddArtifactBMC()
func (*Page) AddCoreFontResource ¶
AddCoreFontResource adds core font to the PDF objects.
func (*Page) AddDestination ¶
func (page *Page) AddDestination(name *string, xPosition, yPosition float32) *Destination
AddDestination adds destination to this page. @param name The destination name. @param xPosition The horizontal position of the destination on this page. @param yPosition The vertical position of the destination on this page.
func (*Page) AddFontResource ¶
AddFontResource adds font to the PDF objects.
func (*Page) AddFooterOffsetBy ¶
AddFooterOffsetBy adds footer to this page offset by the specified value.
func (*Page) AddHeaderOffsetBy ¶
AddHeaderOffsetBy adds header to this page offset by the specified value.
func (*Page) AddImageResource ¶
AddImageResource adds an image to the PDF objects.
func (*Page) AddWatermark ¶
AddWatermark add watermark to the page.
func (*Page) BezierCurveTo ¶
*
- Draws a bezier curve starting from the current point.
- <strong>Please note:</strong> You must call the fillPath, closePath or strokePath method after the last bezierCurveTo call.
- <p><i>Author:</i> <strong>Pieter Libin</strong>, pieter@emweb.be</p> *
- @param p1 first control point
- @param p2 second control point
- @param p3 end point
func (*Page) ClosePath ¶
func (page *Page) ClosePath()
ClosePath closes the path and draws it using the current pen color.
func (*Page) CurveTo ¶
*
- Draws a cubic bezier curve starting from the current point to the end point p3 *
- @param x1 first control point x
- @param y1 first control point y
- @param x2 second control point x
- @param y2 second control point y
- @param x3 end point x
- @param y3 end point y
func (*Page) DrawArrayOfCharacters ¶
DrawArrayOfCharacters draws array of equally spaced characters.
func (*Page) DrawCircle ¶
DrawCircle sdraws a circle on the page.
The outline of the circle is drawn using the current pen color.
@param x the x coordinate of the center of the circle to be drawn. @param y the y coordinate of the center of the circle to be drawn. @param r the radius of the circle to be drawn.
func (*Page) DrawContents ¶
func (page *Page) DrawContents( content []byte, h float32, x float32, y float32, xScale float32, yScale float32)
DrawContents draws the contents on the page.
func (*Page) DrawEllipse ¶
DrawEllipse draws an ellipse on the page using the current pen color. @param x the x coordinate of the center of the ellipse to be drawn. @param y the y coordinate of the center of the ellipse to be drawn. @param r1 the horizontal radius of the ellipse to be drawn. @param r2 the vertical radius of the ellipse to be drawn.
func (*Page) DrawLine ¶
DrawLine draws a line on the page, using the current color, between the points (x1, y1) and (x2, y2).
func (*Page) DrawPath ¶
DrawPath draws or fills the specified path using the current pen or brush. @param path the path. @param operation specifies 'stroke' or 'fill' operation.
func (*Page) DrawPoint ¶
DrawPoint draws a point on the page using the current pen color. @param p the point.
func (*Page) DrawRect ¶
DrawRect draws the outline of the specified rectangle on the page. The left and right edges of the rectangle are at x and x + w. The top and bottom edges are at y and y + h. The rectangle is drawn using the current pen color. @param x the x coordinate of the rectangle to be drawn. @param y the y coordinate of the rectangle to be drawn. @param w the width of the rectangle to be drawn. @param h the height of the rectangle to be drawn.
func (*Page) DrawRectRoundCorners ¶
DrawRectRoundCorners draws rectangle with rounded corners. Code provided by: Dominique Andre Gunia <contact@dgunia.de>
func (*Page) DrawString ¶
DrawString draws a string using the specified font1 and font2 at the x, y location.
func (*Page) DrawStringUsingColorMap ¶
func (page *Page) DrawStringUsingColorMap( font, fallbackFont *Font, text string, x, y float32, brush int32, colors map[string]int32)
DrawStringUsingColorMap draws the text given by the specified string, using the specified main font and the current brush color. If the main font is missing some glyphs - the fallback font is used. The baseline of the leftmost character is at position (x, y) on the page.
func (*Page) FillCircle ¶
FillCircle draws the specified circle on the page and fills it with the current brush color.
@param x the x coordinate of the center of the circle to be drawn. @param y the y coordinate of the center of the circle to be drawn. @param r the radius of the circle to be drawn. @param operation must be Operation.STROKE, Operation.CLOSE or Operation.FILL.
func (*Page) FillEllipse ¶
FillEllipse fills an ellipse on the page using the current pen color. @param x the x coordinate of the center of the ellipse to be drawn. @param y the y coordinate of the center of the ellipse to be drawn. @param r1 the horizontal radius of the ellipse to be drawn. @param r2 the vertical radius of the ellipse to be drawn.
func (*Page) FillPath ¶
func (page *Page) FillPath()
FillPath closes and fills the path with the current brush color.
func (*Page) FillRect ¶
FillRect fills the specified rectangle on the page. The left and right edges of the rectangle are at x and x + w. The top and bottom edges are at y and y + h. The rectangle is drawn using the current pen color. @param x the x coordinate of the rectangle to be drawn. @param y the y coordinate of the rectangle to be drawn. @param w the width of the rectangle to be drawn. @param h the height of the rectangle to be drawn.
func (*Page) GetBrushColor ¶
GetBrushColor returns the brush color. @return the brush color.
func (*Page) GetPenColor ¶
func (*Page) LineTo ¶
LineTo draws a line from the current pen position to the point with coordinates (x, y), using the current pen width and stroke color. Make sure you call strokePath(), closePath() or fillPath() after the last call to this method.
func (*Page) MoveTo ¶
MoveTo moves the pen to the point with coordinates (x, y) on the page.
@param x the x coordinate of new pen position. @param y the y coordinate of new pen position.
func (*Page) SetArtBox ¶
SetArtBox sets the page ArtBox. See page 77 of the PDF32000_2008.pdf specification. @param upperLeftX the top left X coordinate of the ArtBox. @param upperLeftY the top left Y coordinate of the ArtBox. @param lowerRightX the bottom right X coordinate of the ArtBox. @param lowerRightY the bottom right Y coordinate of the ArtBox.
func (*Page) SetBleedBox ¶
SetBleedBox sets the page BleedBox. See page 77 of the PDF32000_2008.pdf specification. @param upperLeftX the top left X coordinate of the BleedBox. @param upperLeftY the top left Y coordinate of the BleedBox. @param lowerRightX the bottom right X coordinate of the BleedBox. @param lowerRightY the bottom right Y coordinate of the BleedBox.
func (*Page) SetBrushColor ¶
SetBrushColor sets the brush color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.
func (*Page) SetBrushColorCMYK ¶
SetBrushColorCMYK sets the color for brush operations using CMYK. This is the color used when drawing regular text and filling shapes. @param c the cyan component is float value from 0.0 to 1.0. @param m the magenta component is float value from 0.0 to 1.0. @param y the yellow component is float value from 0.0 to 1.0. @param k the black component is float value from 0.0 to 1.0.
func (*Page) SetBrushColorRGB ¶
SetBrushColorRGB sets the color for brush operations. This is the color used when drawing regular text and filling shapes. @param r the red component is float value from 0.0 to 1.0. @param g the green component is float value from 0.0 to 1.0. @param b the blue component is float value from 0.0 to 1.0.
func (*Page) SetColorCMYK ¶
SetColorCMYK sets the CMYK color.
func (*Page) SetColorRGB ¶
SetColorRGB sets the RGB color.
func (*Page) SetCropBox ¶
SetCropBox sets the page CropBox. See page 77 of the PDF32000_2008.pdf specification. @param upperLeftX the top left X coordinate of the CropBox. @param upperLeftY the top left Y coordinate of the CropBox. @param lowerRightX the bottom right X coordinate of the CropBox. @param lowerRightY the bottom right Y coordinate of the CropBox.
func (*Page) SetDefaultLinePattern ¶
func (page *Page) SetDefaultLinePattern()
SetDefaultLinePattern sets the default line dash pattern - solid line.
func (*Page) SetDefaultLineWidth ¶
func (page *Page) SetDefaultLineWidth()
SetDefaultLineWidth sets the line width to the default. The default is the finest line width.
func (*Page) SetGraphicsState ¶
func (page *Page) SetGraphicsState(gs *GraphicsState)
SetGraphicsState sets the graphics state. Please see Example_31. @param gs the graphics state to use.
func (*Page) SetLineCapStyle ¶
SetLineCapStyle sets the current line cap style. Supported values: Cap.BUTT, Cap.ROUND and Cap.PROJECTING_SQUARE
func (*Page) SetLineJoinStyle ¶
SetLineJoinStyle sets the line join style. Supported values: Join.MITER, Join.ROUND and Join.BEVEL
func (*Page) SetLinePattern ¶
SetLinePattern the line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units. <pre> Examples of line dash patterns:
"[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
</pre>
@param pattern the line dash pattern.
func (*Page) SetPenColor ¶
SetPenColor sets the pen color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.
func (*Page) SetPenColorCMYK ¶
SetPenColorCMYK sets the color for stroking operations using CMYK. The pen color is used when drawing lines and splines.
@param c the cyan component is float value from 0.0 to 1.0. @param m the magenta component is float value from 0.0 to 1.0. @param y the yellow component is float value from 0.0 to 1.0. @param k the black component is float value from 0.0 to 1.0.
func (*Page) SetPenColorRGB ¶
SetPenColorRGB sets the color for stroking operations. The pen color is used when drawing lines and splines.
@param r the red component is float value from 0.0 to 1.0. @param g the green component is float value from 0.0 to 1.0. @param b the blue component is float value from 0.0 to 1.0.
func (*Page) SetPenWidth ¶
SetPenWidth sets the pen width that will be used to draw lines and splines on this page.
func (*Page) SetTextDirection ¶
SetTextDirection sets the text direction. @param degrees the angle.
func (*Page) SetTextFont ¶
SetTextFont sets the text fonts.
func (*Page) SetTextLeading ¶
func (*Page) SetTextLocation ¶
func (*Page) SetTextRenderingMode ¶
*
- Sets the text rendering mode. *
- @param mode the rendering mode.
func (*Page) SetTextRise ¶
func (*Page) SetTextScaling ¶
func (*Page) SetTrimBox ¶
SetTrimBox sets the page TrimBox. See page 77 of the PDF32000_2008.pdf specification. @param upperLeftX the top left X coordinate of the TrimBox. @param upperLeftY the top left Y coordinate of the TrimBox. @param lowerRightX the bottom right X coordinate of the TrimBox. @param lowerRightY the bottom right Y coordinate of the TrimBox.
func (*Page) StrokePath ¶
func (page *Page) StrokePath()
StrokePath draws the path using the current pen color.
type Paragraph ¶
type Paragraph struct {
// contains filtered or unexported fields
}
Paragraph describes paragraph objects. See the TextColumn class for more information.
func ParagraphsFromFile ¶
func (*Paragraph) Add ¶
Add is used to add new text lines to the paragraph.
@param text the text line to add to paragraph paragraph. @return paragraph paragraph.
func (*Paragraph) GetTextLines ¶
func (*Paragraph) SetAlignment ¶
SetAlignment sets the alignment of the text in paragraph paragraph. @param alignment the alignment code. @return paragraph paragraph. <pre>Supported values: align.Left, align.Right, align.Center and align.Justify.</pre>
func (*Paragraph) SetColorMap ¶
func (*Paragraph) StartsWith ¶
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is used to create path objects. The path objects may consist of lines, splines or both. Please see Example_02.
func (*Path) DrawOn ¶
DrawOn draws this path on the page using the current selected color, pen width, line pattern and line join style. @param page the page to draw this path on. @return x and y coordinates of the bottom right corner of this component.
func (*Path) GetLineCapStyle ¶
GetLineCapStyle returns the line cap style for this path. @return the line cap style for this path.
func (*Path) GetLineJoinStyle ¶
GetLineJoinStyle returns the line join style.
func (*Path) PlaceAtZeroZeroIn ¶
PlaceAtZeroZeroIn places this path in the specified box at position (0.0, 0.0).
func (*Path) PlaceIn ¶
PlaceIn places the path inside the spacified box at coordinates (xOffset, yOffset) of the top left corner. @param box the specified box. @param xOffset the xOffset. @param yOffset the yOffset.
func (*Path) SetClosePath ¶
SetClosePath sets the closePath variable. @param closePath if closePath is true a line will be draw between the first and last point of this path.
func (*Path) SetColor ¶
SetColor sets the pen color that will be used to draw this path. @param color the color is specified as an integer.
func (*Path) SetFillShape ¶
SetFillShape sets the fillShape private variable. If fillShape is true - the shape of the path will be filled with the current brush color. @param fillShape the fillShape flag.
func (*Path) SetLineCapStyle ¶
SetLineCapStyle sets the line cap style. @param style the cap style of this path. Supported values: capstyle.Butt, capstyle.Round and capstyle.ProjectingSquare
func (*Path) SetLineJoinStyle ¶
SetLineJoinStyle sets the line join style. Supported values: Join.MITER, Join.ROUND and Join.BEVEL
func (*Path) SetLocation ¶
SetLocation sets the location of the path.
func (*Path) SetPattern ¶
SetPattern sets the line dash pattern for this path.
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units. <pre> Examples of line dash patterns:
"[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
</pre> @param pattern the line dash pattern.
type PathOp ¶
type PathOp struct {
// contains filtered or unexported fields
}
Path is used to create path objects. The path objects may consist of lines, splines or both. Please see Example_02.
func NewPathOpXY ¶
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point is used to create point objects with different shapes and draw them on a page. Please note: When we are mentioning (x, y) coordinates of a point, we are talking about the coordinates of the center of the point. Please see Example_05.
func GetCurvePoints ¶
GetCurvePoints returns a list containing the start point, first control point, second control point and the end point of elliptical curve segment. Please see Example_18.
@param x the x coordinate of the center of the ellipse. @param y the y coordinate of the center of the ellipse. @param r1 the horizontal radius of the ellipse. @param r2 the vertical radius of the ellipse. @param segment the segment to draw - please see the Segment class. @return a list of the curve points.
func NewControlPoint ¶
NewControlPoint constructor for creating control point objects. @param x the x coordinate of this point when drawn on the page. @param y the y coordinate of this point when drawn on the page. @param isControlPoint true if this point is one of the points specifying a curve.
func NewPoint ¶
NewPoint constructor for creating point objects. @param x the x coordinate of this point when drawn on the page. @param y the y coordinate of this point when drawn on the page.
func (*Point) DrawOn ¶
DrawOn draws this point on the specified page. @param page the page to draw this point on. @return x and y coordinates of the bottom right corner of this component.
func (*Point) GetAlignment ¶
GetAlignment returns the point alignment. @return align the alignment value.
func (*Point) GetFillShape ¶
GetFillShape returns the value of the fillShape private variable. @return the value of the private fillShape variable.
func (*Point) GetLinePattern ¶
GetLinePattern returns the line dash pattern. @return the line dash pattern.
func (*Point) GetLineWidth ¶
GetLineWidth returns the width of the lines used to draw this point. @return the width of the lines used to draw this point.
func (*Point) GetRadius ¶
GetRadius returns the radius of this point. @return the radius of this point.
func (*Point) GetTextColor ¶
GetTextColor returns the point's text color. @return the text color.
func (*Point) GetTextDirection ¶
GetTextDirection returns the point's text direction. @return the text direction.
func (*Point) GetURIAction ¶
GetURIAction returns the URI for the "click point" action. @return the URI for the "click point" action.
func (*Point) GetX ¶
GetX returns the x coordinate of this point. @return the x coordinate of this point.
func (*Point) GetY ¶
GetY returns the y coordinate of this point. @return the y coordinate of this point.
func (*Point) PlaceAtZeroZeroIn ¶
PlaceAtZeroZeroIn places this point in the specified box at position (0f, 0f). @param box the specified box.
func (*Point) PlaceIn ¶
PlaceIn places this point in the specified box. @param box the specified box. @param xOffset the x offset from the top left corner of the box. @param yOffset the y offset from the top left corner of the box.
func (*Point) SetAlignment ¶
SetAlignment sets the point alignment inside table cell. @param align the alignment value.
func (*Point) SetColor ¶
SetColor sets the pen color for this point. @param color the color specified as an integer.
func (*Point) SetDrawPath ¶
SetDrawPath sets this point as the start of a path that will be drawn on the chart.
func (*Point) SetFillShape ¶
SetFillShape sets the private fillShape variable. @param fillShape if true - fill the point with the specified brush color.
func (*Point) SetLinePattern ¶
SetLinePattern sets the line dash pattern that controls the pattern of dashes and gaps used to stroke paths. It is specified by a dash array and a dash phase. The elements of the dash array are positive numbers that specify the lengths of alternating dashes and gaps. The dash phase specifies the distance into the dash pattern at which to start the dash. The elements of both the dash array and the dash phase are expressed in user space units. <pre> Examples of line dash patterns:
"[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
</pre>
@param linePattern the line dash pattern.
func (*Point) SetLineWidth ¶
SetLineWidth sets the width of the lines of this point. @param lineWidth the line width.
func (*Point) SetLocation ¶
SetLocation sets the location (x, y) of this point. @param x the x coordinate of this point when drawn on the page. @param y the y coordinate of this point when drawn on the page.
func (*Point) SetShape ¶
SetShape sets the shape of this point.
@param shape the shape of this point. Supported values: <pre>
shape.Invisible shape.Circle shape.Diamond shape.Box shape.Plus shape.HDash shape.VDash shape.Multiply shape.Star shape.XMark shape.UpArrow shape.DownArrow shape.LeftArrow shape.RightArrow
</pre>
func (*Point) SetTextColor ¶
SetTextColor sets the point's text color. @param textColor the text color.
func (*Point) SetTextDirection ¶
SetTextDirection sets the point's text direction. @param textDirection the text direction.
func (*Point) SetURIAction ¶
SetURIAction sets the URI for the "click point" action. @param uri the URI
type RadioButton ¶
type RadioButton struct {
// contains filtered or unexported fields
}
RadioButton is used to create radio button, which can be set selected or unselected.
func NewRadioButton ¶
func NewRadioButton(font *Font, label string) *RadioButton
NewRadioButton creates RadioButton that is not selected.
func (*RadioButton) DrawOn ¶
func (radioButton *RadioButton) DrawOn(page *Page) []float32
DrawOn draws this RadioButton on the specified Page. @param page the Page where the RadioButton is to be drawn. @return x and y coordinates of the bottom right corner of this component.
func (*RadioButton) SelectButton ¶
func (radioButton *RadioButton) SelectButton(selected bool) *RadioButton
SelectButton selects or deselects this radio button. @param selected the selection flag. @return this RadioButton.
func (*RadioButton) SetActualText ¶
func (radioButton *RadioButton) SetActualText(actualText string) *RadioButton
SetActualText sets the actual text for this radio button. @param actualText the actual text for the radio button. @return this RadioButton.
func (*RadioButton) SetAltDescription ¶
func (radioButton *RadioButton) SetAltDescription(altDescription string) *RadioButton
SetAltDescription sets the alternate description of this radio button. @param altDescription the alternate description of the radio button. @return this RadioButton.
func (*RadioButton) SetFontSize ¶
func (radioButton *RadioButton) SetFontSize(fontSize float32) *RadioButton
SetFontSize sets the font size to use for this text line. @param fontSize the fontSize to use. @return this RadioButton.
func (*RadioButton) SetLocation ¶
func (radioButton *RadioButton) SetLocation(x, y float32) *RadioButton
SetLocation sets the x,y location on the Page. @param x the x coordinate on the Page. @param y the y coordinate on the Page. @return this RadioButton.
func (*RadioButton) SetURIAction ¶
func (radioButton *RadioButton) SetURIAction(uri *string) *RadioButton
SetURIAction sets the URI for the "click text line" action. @param uri the URI. @return this RadioButton.
type Round ¶
type Round struct {
// contains filtered or unexported fields
}
Round is used in the Chart module.
type SVGImage ¶
type SVGImage struct {
// contains filtered or unexported fields
}
func NewSVGImage ¶
*
- Used to embed SVG images in the PDF document. *
- @param stream the input stream.
func NewSVGImageFromFile ¶
func (*SVGImage) SetLocation ¶
type SVGPath ¶
type SVGPath struct {
// contains filtered or unexported fields
}
func NewSVGPath ¶
func NewSVGPath() *SVGPath
type State ¶
type State struct {
// contains filtered or unexported fields
}
State describes the collection of drawing parameters.
func NewState ¶
func NewState( pen [3]float32, brush [3]float32, penWidth float32, lineCapStyle int, lineJoinStyle int, linePattern string) *State
NewState constructs state objects.
func (*State) GetLineCapStyle ¶
GetLineCapStyle returns the line cap style.
func (*State) GetLineJoinStyle ¶
GetLineJoinStyle returns the line join style.
func (*State) GetLinePattern ¶
GetLinePattern returns the line pattern.
func (*State) GetPenWidth ¶
GetPenWidth returns the pen width.
type StructElem ¶
type StructElem struct {
// contains filtered or unexported fields
}
StructElem is used to create PDF structure element objects.
func (*StructElem) GetPageObjNumber ¶
func (structElem *StructElem) GetPageObjNumber() int
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is used to create table objects and draw them on a page. Please see Example_08.
func NewTableFromFile ¶
func (*Table) DrawOn ¶
DrawOn draws this table on the specified page. @param page the page to draw this table on. @return Point the point on the page where to draw the next component.
func (*Table) DrawOnPages ¶
DrawOnPages draws the table on pdf pages with the specified size.
func (*Table) GetCellAt ¶
GetCellAt returns the cell at the specified row and column. @param row the specified row. @param col the specified column. @return the cell at the specified row and column.
func (*Table) GetCellAtRowColumn ¶
GetCellAtRowColumn returns the cell at the specified row and column. @param row the specified row. @param col the specified column. @return the cell at the specified row and column.
func (*Table) GetColumn ¶
GetColumn returns a list of cell for the specified column. @param index the index of the specified column. @return the list of cells.
func (*Table) GetColumnAtIndex ¶
GetColumnAtIndex return the column at the specified index.
func (*Table) GetColumnWidth ¶
GetColumnWidth returns the column width of the column at the specified index. @param index the index of the column. @return the width of the column.
func (*Table) GetRow ¶
GetRow returns a list of cell for the specified row. @param index the index of the specified row. @return the list of cells.
func (*Table) GetRowAtIndex ¶
GetRowAtIndex returns the row at the specified index.
func (*Table) GetRowsRendered ¶
GetRowsRendered returns the number of data rows that have been rendered so far. @return the number of data rows that have been rendered so far.
func (*Table) GetWidth ¶
GetWidth returns the width of table table when drawn on a page. @return the widht of table table.
func (*Table) RemoveLineBetweenRows ¶
RemoveLineBetweenRows removes the horizontal lines between the rows from index1 to index2.
func (*Table) RightAlignNumbers ¶
func (table *Table) RightAlignNumbers()
RightAlignNumbers sets the alignment of the numbers.
func (*Table) SetBottomMargin ¶
SetBottomMargin sets the bottom margin for table. @param bottomMargin the margin.
func (*Table) SetCellBorders ¶
SetNoCellBorders sets all table cells borders to <strong>false</strong> or <strong>true</strong>.
func (*Table) SetCellBordersColor ¶
SetCellBordersColor sets the color of the cell border lines. @param color the color of the cell border lines.
func (*Table) SetCellBordersWidth ¶
SetCellBordersWidth sets the width of the cell border lines. @param width the width of the border lines.
func (*Table) SetColumnWidth ¶
SetColumnWidth sets the width of the column with the specified index. @param index the index of specified column. @param width the specified width.
func (*Table) SetColumnWidths ¶
func (table *Table) SetColumnWidths()
Auto adjusts the widths of all columns so that they are just wide enough to hold the text without truncation.
func (*Table) SetData ¶
SetData sets the table data and specifies the number of header rows in table data.
func (*Table) SetFontInColumn ¶
SetFontInColumn sets the font for the specified column. @param index the column index. @param font the font.
func (*Table) SetFontInRow ¶
SetFontInRow sets the font for the specified row. @param index the row index. @param font the font.
func (*Table) SetLocation ¶
SetLocation sets the location (x, y) of the top left corner of table on the page. @param x the x coordinate of the top left point of the table. @param y the y coordinate of the top left point of the table.
func (*Table) SetLocationFirstPage ¶
func (*Table) SetTextAlignInColumn ¶
SetTextAlignInColumn sets the text alignment in the specified column.
@param index the index of the specified column. @param alignment the specified alignment. Supported values: Align.LEFT, Align.RIGHT, Align.CENTER and Align.JUSTIFY.
func (*Table) SetTextColorInColumn ¶
SetTextColorInColumn sets the color of the text in the specified column. @param index the index of the specified column. @param color the color specified as an integer.
func (*Table) SetTextColorInRow ¶
SetTextColorInRow sets the color of the text in the specified row. @param index the index of the specified row. @param color the color specified as an integer.
func (*Table) SetVisibleColumns ¶
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
Text structure Please see Example_45
func (*Text) SetLeading ¶
SetLeading sets the leading of the text.
func (*Text) SetLocation ¶
SetLocation sets the location of the text.
func (*Text) SetParagraphLeading ¶
SetParagraphLeading sets the paragraph leading.
func (*Text) SetSpaceBetweenTextLines ¶
SetSpaceBetweenTextLines sets the space between text lines.
type TextBox ¶
type TextBox struct {
// contains filtered or unexported fields
}
TextBox creates box containing line-wrapped text. <p>Defaults:<br /> x = 0.0<br /> y = 0.0<br /> width = 300.0<br /> height = 0.0<br /> alignment = align.Left<br /> valign = align.Top<br /> spacing = 0.0<br /> margin = 0.0<br /> </p> This class was originally developed by Ronald Bourret. It was completely rewritten in 2013 by Eugene Dragoev.
func (*TextBox) DrawOn ¶
DrawOn draws textBox text box on the specified page. @param page the Page where the TextBox is to be drawn. @param draw flag specifying if textBox component should actually be drawn on the page. @return x and y coordinates of the bottom right corner of textBox component.
func (*TextBox) DrawText ¶
func (textBox *TextBox) DrawText( page *Page, font, fallbackFont *Font, text string, xText float32, yText float32, brush int32, colors map[string]int32)
DrawText draws the text on the page.
func (*TextBox) GetBgColor ¶
GetBgColor returns the background color. @return int the color as 0xRRGGBB integer.
func (*TextBox) GetBorder ¶
GetBorder returns the text box border property values. @return boolean true if the specific border property value is set.
func (*TextBox) GetBrushColor ¶
GetBrushColor returns the brush color. @return int the brush color specified as 0xRRGGBB integer.
func (*TextBox) GetFallbackFont ¶
GetFallbackFont returns the fallback font.
func (*TextBox) GetLineWidth ¶
GetLineWidth returns the border line width. @return float the line width.
func (*TextBox) GetLocation ¶
GetLocation gets the location where textBox text box will be drawn on the page.
func (*TextBox) GetMargin ¶
GetMargin returns the text box margin. @return the margin between the text and the box
func (*TextBox) GetPenColor ¶
GetPenColor returns the pen color as 0xRRGGBB integer. @return int the pen color.
func (*TextBox) GetSpacing ¶
GetSpacing returns the spacing between lines of text. @return float the spacing.
func (*TextBox) GetStrikeout ¶
GetStrikeout returns the strikeout flag.
func (*TextBox) GetTextAlignment ¶
GetTextAlignment returns the text alignment. @return alignment the alignment code. Supported values: align.Left, align.Right and align.Center
func (*TextBox) GetTextColors ¶
GetTextColors returns the text colors map.
func (*TextBox) GetUnderline ¶
GetUnderline returns underlined flag.
func (*TextBox) GetVerticalAlignment ¶
GetVerticalAlignment returns the vertical alignment setting.
func (*TextBox) GetX ¶
GetX gets the x coordinate where textBox text box will be drawn on the page. @return the x coordinate of the top left corner of the text box.
func (*TextBox) GetY ¶
GetY gets the y coordinate where textBox text box will be drawn on the page.
@return the y coordinate of the top left corner of the text box.
func (*TextBox) SetBgColor ¶
SetBgColor sets the background to the specified color. @param color the color specified as 0xRRGGBB integer.
func (*TextBox) SetBgColorRGB ¶
SetBgColor sets the background to the specified color using RGB values. @param color the color specified as array of integer values from 0x00 to 0xFF.
func (*TextBox) SetBorder ¶
SetBorder sets the TextBox border properties. @param border the border properties.
func (*TextBox) SetBorders ¶
SetBorder sets all the TextBox borders. @param borders sets all borders if true, no borders otherwise.
func (*TextBox) SetBrushColor ¶
Sets the brush color. @param color the color specified as 0xRRGGBB integer.
func (*TextBox) SetBrushColorRGB ¶
SetBrushColor sets the brush color. @param color the color specified as an array of int values from 0x00 to 0xFF.
func (*TextBox) SetFallbackFont ¶
SetFallbackFont sets the fallback font.
func (*TextBox) SetFgColor ¶
Sets the pen and brush colors to the specified color. @param color the color specified as 0xRRGGBB integer.
func (*TextBox) SetFgColorRGB ¶
SetFgColor sets the pen and brush colors to the specified color using RGB values. @param color the color specified as 0xRRGGBB integer.
func (*TextBox) SetHeight ¶
SetHeight sets the height of textBox text box. @param height the specified height.
func (*TextBox) SetLineWidth ¶
SetLineWidth sets the border line width. @param lineWidth float
func (*TextBox) SetLocation ¶
SetLocation sets the location where textBox text box will be drawn on the page. @param x the x coordinate of the top left corner of the text box. @param y the y coordinate of the top left corner of the text box.
func (*TextBox) SetMargin ¶
SetMargin sets the margin of textBox text box. @param margin the margin between the text and the box
func (*TextBox) SetPenColor ¶
Sets the pen color. @param color the color specified as 0xRRGGBB integer.
func (*TextBox) SetPenColorRGB ¶
SetPenColor sets the pen color using RGB values. @param color the color specified as an array of int values from 0x00 to 0xFF.
func (*TextBox) SetPosition ¶
SetPosition sets the location where textBox text box will be drawn on the page. @param x the x coordinate of the top left corner of the text box. @param y the y coordinate of the top left corner of the text box.
func (*TextBox) SetSpacing ¶
SetSpacing sets the spacing between lines of text. @param spacing
func (*TextBox) SetStrikeout ¶
SetStrikeout sets the srikeout flag. In the flag is true - draw strikeout line through the text.
func (*TextBox) SetTextAlignment ¶
SetTextAlignment sets the cell text alignment. @param alignment the alignment code. Supported values: align.Left, align.Right and align.Center
func (*TextBox) SetTextColors ¶
SetTextColors sets the text colors map.
func (*TextBox) SetTextDirection ¶
func (*TextBox) SetURIAction ¶
SetURIAction -- TODO:
func (*TextBox) SetUnderline ¶
SetUnderline sets the underline variable. If the value of the underline variable is 'true' - the text is underlined.
func (*TextBox) SetVerticalAlignment ¶
SetVerticalAlignment sets the vertical alignment of the text in textBox TextBox. Valid values are align.Top, align.Bottom and align.Center
type TextColumn ¶
type TextColumn struct {
// contains filtered or unexported fields
}
TextColumn is used to create text column objects and draw them on a page.
Please see Example_10.
func NewTextColumn ¶
func NewTextColumn(rotateByDegrees int) *TextColumn
NewTextColumn used to create a text column object and set the rotation angle. @param rotateByDegrees the specified rotation angle in degrees.
func (*TextColumn) AddChineseParagraph ¶
func (textColumn *TextColumn) AddChineseParagraph(font *Font, text string)
AddChineseParagraph adds a new paragraph with Chinese text to this text column.
@param font the font used by this paragraph. @param chinese the Chinese text.
func (*TextColumn) AddJapaneseParagraph ¶
func (textColumn *TextColumn) AddJapaneseParagraph(font *Font, text string)
AddJapaneseParagraph adds a new paragraph with Japanese text to this text column. @param font the font used by this paragraph. @param japanese the Japanese text.
func (*TextColumn) AddParagraph ¶
func (textColumn *TextColumn) AddParagraph(paragraph *Paragraph)
AddParagraph adds a new paragraph to this text column.
func (*TextColumn) DrawOn ¶
func (textColumn *TextColumn) DrawOn(page *Page) []float32
DrawOn draws this text column on the specified page if the 'draw' boolean value is 'true'.
@param page the page to draw this text column on. @param draw the boolean value that specified if the text column should actually be drawn on the page. @return the point with x and y coordinates of the location where to draw the next component.
func (*TextColumn) GetSize ¶
func (textColumn *TextColumn) GetSize() *Dimension
GetSize returns dimension object containing the width and height of this component.
func (*TextColumn) RemoveLastParagraph ¶
func (textColumn *TextColumn) RemoveLastParagraph()
RemoveLastParagraph removes the last paragraph added to this text column.
func (*TextColumn) SetAlignment ¶
func (textColumn *TextColumn) SetAlignment(alignment int)
SetAlignment sets the text alignment. Supported values: align.Left, align.Right, align.Center and align.Justify
func (*TextColumn) SetLineBetweenParagraphs ¶
func (textColumn *TextColumn) SetLineBetweenParagraphs(lineBetweenParagraphs bool)
SetLineBetweenParagraphs sets the lineBetweenParagraphs private variable value. If the value is set to true - an empty line will be inserted between the current and next paragraphs. @param lineBetweenParagraphs the specified boolean value.
func (*TextColumn) SetLineSpacing ¶
func (textColumn *TextColumn) SetLineSpacing(spacing float32)
SetLineSpacing sets the spacing between the lines in this text column.
func (*TextColumn) SetLocation ¶
func (textColumn *TextColumn) SetLocation(x, y float32)
SetLocation sets the position of this text column on the page. @param x the x coordinate of the top left corner of this text column when drawn on the page. @param y the y coordinate of the top left corner of this text column when drawn on the page.
func (*TextColumn) SetSize ¶
func (textColumn *TextColumn) SetSize(w, h float32)
SetSize sets the size of this text column. @param w the width of this text column. @param h the height of this text column.
func (*TextColumn) SetSpaceBetweenLines ¶
func (textColumn *TextColumn) SetSpaceBetweenLines(spaceBetweenLines float32)
SetSpaceBetweenLines sets the space between the lines.
func (*TextColumn) SetSpaceBetweenParagraphs ¶
func (textColumn *TextColumn) SetSpaceBetweenParagraphs(spaceBetweenParagraphs float32)
SetSpaceBetweenParagraphs sets the space between the paragraphs.
func (*TextColumn) SetWidth ¶
func (textColumn *TextColumn) SetWidth(w float32)
SetWidth sets the desired width of this text column. @param w the width of this text column.
type TextFrame ¶
type TextFrame struct {
// contains filtered or unexported fields
}
TextFrame please see Example_47
func NewTextFrame ¶
NewTextFrame constructs new text frame.
func (*TextFrame) DrawBorder ¶
func (*TextFrame) GetBeginParagraphPoints ¶
GetBeginParagraphPoints returns the begin paragraph points.
func (*TextFrame) GetParagraphs ¶
GetParagraphs returns the paragraphs.
func (*TextFrame) IsNotEmpty ¶
IsNotEmpty returns true if there is more text to draw, otherwise it returns false.
func (*TextFrame) SetDrawBorder ¶
SetDrawBorder sets the 'set border' variable.
func (*TextFrame) SetLeading ¶
SetLeading sets the text lines leading.
func (*TextFrame) SetLocation ¶
SetLocation sets the location of the frame on the page.
func (*TextFrame) SetParagraphLeading ¶
SetParagraphLeading sets the paragraph leading.
func (*TextFrame) SetPosition ¶
SetPosition sets the position of the text frame on the page.
func (*TextFrame) SetSpaceBetweenTextLines ¶
SetSpaceBetweenTextLines sets the space between the text lines.
type TextLine ¶
type TextLine struct {
// contains filtered or unexported fields
}
TextLine is used to create text line objects.
func NewEmptyTextLine ¶
NewTextLine is constructor for creating empty text line objects. @param font the font to use.
func NewTextLine ¶
NewTextLine is constructor for creating text line objects. @param font the font to use. @param text the text.
func (*TextLine) DrawOn ¶
DrawOn draws this text line on the specified page if the draw parameter is true. @param page the page to draw this text line on. @param draw if draw is false - no action is performed.
func (*TextLine) GetActualText ¶
GetActualText gets the actual text.
func (*TextLine) GetAltDescription ¶
GetAltDescription gets the alternate description of this text line.
func (*TextLine) GetColorMap ¶
func (*TextLine) GetDestinationX ¶
GetDestinationX returns the x coordinate of the destination. @return the x coordinate of the destination.
func (*TextLine) GetDestinationY ¶
GetDestinationY returns the y coordinate of the destination. @return the y coordinate of the destination.
func (*TextLine) GetFallbackFont ¶
GetFallbackFont returns the fallback font. @return the fallback font.
func (*TextLine) GetFont ¶
GetFont gets the font to use for this text line. @return font the font to use.
func (*TextLine) GetGoToAction ¶
GetGoToAction returns the GoTo action string. @return the GoTo action string.
func (*TextLine) GetLanguage ¶
GetLanguage gets the language.
func (*TextLine) GetStrikeout ¶
GetStrikeout returns the strikeout flag. @return the strikeout flag.
func (*TextLine) GetStringWidth ¶
GetWidth returns the width of this TextLine. @return the width.
func (*TextLine) GetTextDirection ¶
GetTextDirection returns the text direction. @return the text direction.
func (*TextLine) GetTextEffect ¶
GetTextEffect returns the text effect. @return the text effect.
func (*TextLine) GetTrailingSpace ¶
GetTrailingSpace returns the trailing space. @return the trailing space.
func (*TextLine) GetURIAction ¶
GetURIAction returns the action URI. @return the action URI.
func (*TextLine) GetUnderline ¶
GetUnderline returns the underline flag. @return the underline flag.
func (*TextLine) GetVerticalOffset ¶
GetVerticalOffset returns the vertical text offset. @return the vertical text offset.
func (*TextLine) PlaceIn ¶
PlaceIn places this text line in the box at the specified offset. @param box the specified box. @param xOffset the x offset from the top left corner of the box. @param yOffset the y offset from the top left corner of the box. @return this TextLine.
func (*TextLine) PlaceInAtZeroZero ¶
PlaceInAtZeroZero places this text line in the specified box at location (0.0, 0.0)
func (*TextLine) SetActualText ¶
SetActualText sets the actual text for this text line. @param actualText the actual text for the text line. @return this TextLine.
func (*TextLine) SetAltDescription ¶
SetAltDescription sets the alternate description of this text line. @param altDescription the alternate description of the text line. @return this TextLine.
func (*TextLine) SetColor ¶
SetColor sets the color for this text line. @param color the color is specified as an integer. @return this TextLine.
func (*TextLine) SetColorMap ¶
func (*TextLine) SetColorRGB ¶
SetColorRGB sets the pen color. @param color the color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers. @return this TextLine.
func (*TextLine) SetFallbackFont ¶
SetFallbackFont sets the fallback font. @param fallbackFont the fallback font. @return this TextLine.
func (*TextLine) SetFallbackFontSize ¶
SetFallbackFontSize sets the fallback font size to use for this text line. @param fallbackFontSize the fallback font size. @return this TextLine.
func (*TextLine) SetFont ¶
SetFont sets the font to use for this text line. @param font the font to use. @return this TextLine.
func (*TextLine) SetFontSize ¶
SetFontSize sets the font size to use for this text line. @param fontSize the fontSize to use. @return this TextLine.
func (*TextLine) SetGoToAction ¶
SetGoToAction sets the destination key for the action. @param key the destination name. @return this TextLine.
func (*TextLine) SetLanguage ¶
SetLanguage sets the language.
func (*TextLine) SetLocation ¶
SetLocation sets the location where this text line will be drawn on the page. @param x the x coordinate of the text line. @param y the y coordinate of the text line. @return this TextLine.
func (*TextLine) SetStrikeout ¶
SetStrikeout sets the strike variable. If the value of the strike variable is 'true' - a strike line is drawn through the text. @param strikeout the strikeout flag. @return this TextLine.
func (*TextLine) SetStructureType ¶
SetStructureType sets the type of the structure.
func (*TextLine) SetTextDirection ¶
SetTextDirection sets the direction in which to draw the text. @param degrees the number of degrees. @return this TextLine.
func (*TextLine) SetTextEffect ¶
SetTextEffect sets the text effect. @param textEffect Effect.NORMAL, Effect.SUBSCRIPT or Effect.SUPERSCRIPT. @return this TextLine.
func (*TextLine) SetTrailingSpace ¶
SetTrailingSpace sets the trailing space after this text line when used in paragraph. @param trailingSpace the trailing space. @return this TextLine.
func (*TextLine) SetURIAction ¶
SetURIAction sets the URI for the "click text line" action. @param uri the URI @return this TextLine.
func (*TextLine) SetURIActualText ¶
SetURIActualText sets the URI actual text.
func (*TextLine) SetURIAltDescription ¶
SetURIAltDescription sets the URI alternative description.
func (*TextLine) SetURILanguage ¶
SetURILanguage sets the URI language.
func (*TextLine) SetUnderline ¶
SetUnderline sets the underline variable. If the value of the underline variable is 'true' - the text is underlined. @param underline the underline flag. @return this TextLine.
func (*TextLine) SetVerticalOffset ¶
SetVerticalOffset sets the vertical offset of the text. @param verticalOffset the vertical offset. @return this TextLine.
type Title ¶
type Title struct {
// contains filtered or unexported fields
}
Title is used to create title objects that have prefix and text. Please see Example_51 and Example_52
Source Files ¶
- annotation.go
- barcode.go
- barcode2d.go
- bidi.go
- bmpimage.go
- bookmark.go
- box.go
- calendarmonth.go
- cell.go
- chart.go
- checkbox.go
- chunk.go
- colormap.go
- compositetextline.go
- corefont.go
- destination.go
- dimension.go
- donutchart.go
- drawable.go
- embeddedfile.go
- field.go
- fileattachment.go
- font.go
- fontstream1.go
- fontstream2.go
- form.go
- graphicsstate.go
- helperfunctions.go
- iccblackscaled.go
- image.go
- jpgimage.go
- line.go
- opentypefont.go
- optionalcontentgroup.go
- otf.go
- page.go
- paragraph.go
- path.go
- pathop.go
- pdf.go
- pdfobj.go
- pngimage.go
- point.go
- radiobutton.go
- round.go
- slice.go
- state.go
- structelem.go
- svg.go
- svgimage.go
- svgpath.go
- table.go
- text.go
- textbox.go
- textcolumn.go
- textframe.go
- textline.go
- textutils.go
- title.go