pdfjet

package module
v0.0.0-...-2660072 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Upc = iota
	CODE128
	CODE39
)

Constants

View Source
const (
	LeftToRight = iota
	TopToBottom
	BottomToTop
)

Constants

View Source
const (
	ALPHA        = 0x08
	LOWER        = 0x04
	MIXED        = 0x02
	PUNCT        = 0x01
	LatchToLower = 27
	ShiftToAlpha = 27
	LatchToMixed = 28
	LatchToAlpha = 28
	ShiftToPunct = 29
)

Constants

View Source
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.

View Source
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"
)
View Source
const (
	TableWith0HeaderRows = iota
	TableWith1HeaderRow
	TableWith2HeaderRows
	TableWith3HeaderRows
	TableWith4HeaderRows
	TableWith5HeaderRows
	TableWith6HeaderRows
	TableWith7HeaderRows
	TableWith8HeaderRows
	TableWith9HeaderRows
)

Constants

Variables

View Source
var ICCBlackScaledProfile = []byte{}/* 2577 elements not displayed */

ICCBlackScaledProfile is used in the pdf.go

Functions

func DrawSlice

func DrawSlice(
	page *Page,
	fillColor int32,
	xc, yc, r1, r2, a1, a2 float32) float32

func FontStream1

func FontStream1(pdf *PDF, font *Font, reader io.Reader)

FontStream1 is used to add stream fonts to the PDF.

func FontStream2

func FontStream2(objects *[]*PDFobj, font *Font, reader io.Reader)

FontStream2 constructs font object and adds it to the PDF objects slice.

func GetControlPoints

func GetControlPoints(xc, yc, x0, y0, x3, y3 float32) [][2]float32

func GetPoint

func GetPoint(xc, yc, radius, angle float32) [2]float32

func NewColorMap

func NewColorMap() map[string]int32

Please see: https://www.w3.org/TR/css-color-3/#svg-color

func PrintDuration

func PrintDuration(example string, duration time.Duration)

func ReadTextLines

func ReadTextLines(filePath string) []string

func ReorderVisually

func ReorderVisually(text string) string

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

func XMarkCheckBox(page *Page, x, y, size float32)

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

func NewBMPImage(reader io.Reader) *BMPImage

NewBMPImage constructs bitmap image objects.

func (*BMPImage) GetData

func (image *BMPImage) GetData() []byte

GetData returns the compressed image data.

func (*BMPImage) GetHeight

func (image *BMPImage) GetHeight() float32

GetHeight returns the image height.

func (*BMPImage) GetWidth

func (image *BMPImage) GetWidth() float32

GetWidth returns the image width.

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

func NewBarcode(barcodeType int, text string) *Barcode

NewBarcode constructs barcode objects. @param type the type of the barcode. @param str the content string of the barcode.

func (*Barcode) DrawOn

func (barcode *Barcode) DrawOn(page *Page) []float32

DrawOn draws this barcode on the specified page.

func (*Barcode) GetHeight

func (barcode *Barcode) GetHeight() float32

GetHeight -- TODO:

func (*Barcode) SetBarHeightFactor

func (barcode *Barcode) SetBarHeightFactor(barHeightFactor float32)

SetBarHeightFactor sets the bar height factor. The height of the bars is the moduleLength * barHeightFactor The default value is 50.0f

func (*Barcode) SetDirection

func (barcode *Barcode) SetDirection(direction int)

SetDirection sets the drawing direction for this font. @param direction the specified direction.

func (*Barcode) SetFont

func (barcode *Barcode) SetFont(font *Font)

SetFont sets the font to be used with this barcode. @param font the specified font.

func (*Barcode) SetLocation

func (barcode *Barcode) SetLocation(x1, y1 float32)

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

func (barcode *Barcode) SetModuleLength(moduleLength float32)

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

func NewBarcode2D(str string) *Barcode2D

NewBarcode2D constructor for 2D barcodes. @param str the specified string.

func (*Barcode2D) DrawOn

func (barcode *Barcode2D) DrawOn(page *Page) []float32

DrawOn draws this barcode on the specified page. @return x and y coordinates of the bottom right corner of this component.

func (*Barcode2D) SetLocation

func (barcode *Barcode2D) SetLocation(x, y float32)

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

func (barcode *Barcode2D) SetModuleWidth(width float32)

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

func (barcode *Barcode2D) SetPosition(x, y float32)

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 NewBookmark

func NewBookmark(pdf *PDF) *Bookmark

NewBookmark creates new bookmark.

func NewBookmarkAt

func NewBookmarkAt(page *Page, y float32, key, title string) *Bookmark

NewBookmarkAt creates new bookmark at the specified y coordinate.

func (*Bookmark) AddBookmark

func (bookmark *Bookmark) AddBookmark(page *Page, title *Title) *Bookmark

AddBookmark adds bookmark to the page.

func (*Bookmark) AutoNumber

func (bookmark *Bookmark) AutoNumber(textLine *TextLine) *Bookmark

AutoNumber auto numbers the bookmark.

func (*Bookmark) GetDestKey

func (bookmark *Bookmark) GetDestKey() string

GetDestKey returns the destination key.

func (*Bookmark) GetParent

func (bookmark *Bookmark) GetParent() *Bookmark

GetParent returns the parent bookmark.

func (*Bookmark) GetTitle

func (bookmark *Bookmark) GetTitle() string

GetTitle returns the title of the bookmark.

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 NewBox

func NewBox() *Box

NewBox creates new Box object.

func NewBoxAt

func NewBoxAt(x, y, w, h float32) *Box

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

func (box *Box) DrawOn(page *Page) []float32

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

func (box *Box) PlaceIn(box2 *Box, xOffset, yOffset float32)

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

func (box *Box) ScaleBy(factor float32)

ScaleBy scales this box by the spacified factor. @param factor the factor used to scale the box.

func (*Box) SetActualText

func (box *Box) SetActualText(actualText string) *Box

SetActualText sets the actual text for this box. @param actualText the actual text for the box. @return this Box.

func (*Box) SetAltDescription

func (box *Box) SetAltDescription(altDescription string) *Box

SetAltDescription sets the alternate description of this box. @param altDescription the alternate description of the box. @return this Box.

func (*Box) SetColor

func (box *Box) SetColor(color int32)

SetColor sets the color for this box. @param color the color specified as an integer.

func (*Box) SetFillShape

func (box *Box) SetFillShape(fillShape bool)

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

func (box *Box) SetGoToAction(key *string)

SetGoToAction sets the destination key for the action. @param key the destination name.

func (*Box) SetLineWidth

func (box *Box) SetLineWidth(width float32)

SetLineWidth sets the width of this line. @param width the width.

func (*Box) SetLocation

func (box *Box) SetLocation(x, y float32) *Box

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

func (box *Box) SetPattern(pattern string)

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

func (box *Box) SetSize(w, h float32)

SetSize sets the size of this box. @param w the width of this box. @param h the height of this box.

func (*Box) SetStructureType

func (box *Box) SetStructureType(structureType string) *Box

SetStructureType sets the type of the structure.

func (*Box) SetURIAction

func (box *Box) SetURIAction(uri *string)

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

func NewCell(font *Font, text string) *Cell

NewCell creates a cell object and sets the font and the cell text. @param font the font. @param text the text.

func NewEmptyCell

func NewEmptyCell(font *Font) *Cell

NewEmptyCell creates a cell object and sets the font. @param font the font.

func (*Cell) DrawOn

func (cell *Cell) DrawOn(page *Page, x, y, w, h float32)

DrawOn draws the point, text and borders of this cell.

func (*Cell) DrawText

func (cell *Cell) DrawText(page *Page, x, y, wCell, hCell float32)

DrawText draws the cell text.

func (*Cell) GetBgColor

func (cell *Cell) GetBgColor() int32

GetBgColor returns the background color of this cell.

func (*Cell) GetBorder

func (cell *Cell) GetBorder(border int) bool

GetBorder returns the cell border object. @return the cell border object.

func (*Cell) GetBrushColor

func (cell *Cell) GetBrushColor() int32

GetBrushColor returns the brush color. @return the brush color.

func (*Cell) GetColSpan

func (cell *Cell) GetColSpan() int

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

func (cell *Cell) GetFallbackFont() *Font

GetFallbackFont returns the fallback font used by this cell. @return the fallback font.

func (*Cell) GetFont

func (cell *Cell) GetFont() *Font

GetFont returns the font used by this cell. @return the font.

func (*Cell) GetHeight

func (cell *Cell) GetHeight(width float32) float32

GetHeight returns the cell height. @return the cell height.

func (*Cell) GetImage

func (cell *Cell) GetImage() *Image

GetImage returns the cell image.

func (*Cell) GetLineWidth

func (cell *Cell) GetLineWidth() float32

GetLineWidth returns the border line width.

func (*Cell) GetPenColor

func (cell *Cell) GetPenColor() int32

GetPenColor returns the pen color.

func (*Cell) GetPoint

func (cell *Cell) GetPoint() *Point

GetPoint returns the cell point.

func (*Cell) GetProperties

func (cell *Cell) GetProperties() uint32

GetProperties returns the properties.

func (*Cell) GetStrikeout

func (cell *Cell) GetStrikeout() bool

GetStrikeout returns the strikeout text parameter. @return the strikeout text parameter.

func (*Cell) GetText

func (cell *Cell) GetText() string

GetText returns the cell text.

func (*Cell) GetTextAlignment

func (cell *Cell) GetTextAlignment() int

GetTextAlignment returns the text alignment. @return the text horizontal alignment code.

func (*Cell) GetTextBox

func (cell *Cell) GetTextBox() *TextBox

GetTextBox returns the cell's text box.

func (*Cell) GetUnderline

func (cell *Cell) GetUnderline() bool

GetUnderline returns the underline text parameter. @return the underline text parameter.

func (*Cell) GetVerTextAlignment

func (cell *Cell) GetVerTextAlignment() int

GetVerTextAlignment returns the cell text vertical alignment. @return the vertical alignment code.

func (*Cell) GetWidth

func (cell *Cell) GetWidth() float32

GetWidth returns the cell width. @return the cell width.

func (*Cell) SetBarcode

func (cell *Cell) SetBarcode(barcode *Barcode)

SetBarcode -- TODO:

func (*Cell) SetBgColor

func (cell *Cell) SetBgColor(color int32)

SetBgColor sets the background to the specified color. @param color the color specified as 0xRRGGBB integer.

func (*Cell) SetBorder

func (cell *Cell) SetBorder(border int, visible bool)

SetBorder sets the cell border object. @param border the border object.

func (*Cell) SetBorders

func (cell *Cell) SetBorders(borders bool)

SetBorders sets all cell borders to true or false.

func (*Cell) SetBottomPadding

func (cell *Cell) SetBottomPadding(padding float32)

SetBottomPadding sets the bottom padding of this cell. @param padding the bottom padding.

func (*Cell) SetBrushColor

func (cell *Cell) SetBrushColor(color int32)

SetBrushColor sets the brush color. @param color the color specified as 0xRRGGBB integer.

func (*Cell) SetColSpan

func (cell *Cell) SetColSpan(colspan int)

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

func (cell *Cell) SetFallbackFont(fallbackFont *Font)

SetFallbackFont sets the fallback font for this cell. @param fallbackFont the fallback font.

func (*Cell) SetFgColor

func (cell *Cell) SetFgColor(color int32)

SetFgColor sets the pen and brush colors to the specified color. @param color the color specified as 0xRRGGBB integer.

func (*Cell) SetFont

func (cell *Cell) SetFont(font *Font)

SetFont sets the font for this cell. @param font the font.

func (*Cell) SetImage

func (cell *Cell) SetImage(image *Image)

SetImage sets the image inside this cell.

func (*Cell) SetLeftPadding

func (cell *Cell) SetLeftPadding(padding float32)

SetLeftPadding sets the left padding of this cell. @param padding the left padding.

func (*Cell) SetLineWidth

func (cell *Cell) SetLineWidth(lineWidth float32)

SetLineWidth sets the border line width.

func (*Cell) SetPadding

func (cell *Cell) SetPadding(padding float32)

SetPadding sets the top, bottom, left and right paddings of this cell. @param padding the right padding.

func (*Cell) SetPenColor

func (cell *Cell) SetPenColor(color int32)

SetPenColor sets the pen color. @param color the color specified as 0xRRGGBB integer.

func (*Cell) SetPoint

func (cell *Cell) SetPoint(point *Point)

SetPoint sets the point inside this cell. See the Point class and Example_09 for more information.

func (*Cell) SetProperties

func (cell *Cell) SetProperties(properties uint32)

SetProperties sets the properties.

func (*Cell) SetRightPadding

func (cell *Cell) SetRightPadding(padding float32)

SetRightPadding sets the right padding of this cell. @param padding the right padding.

func (*Cell) SetStrikeout

func (cell *Cell) SetStrikeout(strikeout bool)

SetStrikeout sets the strikeout text parameter. @param strikeout the strikeout text parameter.

func (*Cell) SetText

func (cell *Cell) SetText(text string)

SetText sets the cell text. @param text the cell text.

func (*Cell) SetTextAlignment

func (cell *Cell) SetTextAlignment(alignment int)

SetTextAlignment sets the cell text alignment. @param alignment the alignment code. Supported values: align.Left, align.Right and align.Center

func (*Cell) SetTextBox

func (cell *Cell) SetTextBox(textBox *TextBox)

SetTextBox sets the composite text object. @param compositeTextLine the composite text object.

func (*Cell) SetTopPadding

func (cell *Cell) SetTopPadding(padding float32)

SetTopPadding sets the top padding of this cell. @param padding the top padding.

func (*Cell) SetURIAction

func (cell *Cell) SetURIAction(uri *string)

SetURIAction sets the URI action.

func (*Cell) SetUnderline

func (cell *Cell) SetUnderline(underline bool)

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

func (cell *Cell) SetVerTextAlignment(alignment int)

SetVerTextAlignment sets the cell text vertical alignment. @param alignment the alignment code. Supported values: align.Top, align.Center and align.Bottom

func (*Cell) SetWidth

func (cell *Cell) SetWidth(width float32)

SetWidth sets the width of this cell. @param width the specified width.

func (*Cell) StrikeoutText

func (cell *Cell) StrikeoutText(page *Page, font *Font, text string, x, y float32)

StrikeoutText strikes out the cell text.

func (*Cell) UnderlineText

func (cell *Cell) UnderlineText(page *Page, font *Font, text string, x, y float32)

UnderlineText underlines 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

func NewChart(f1, f2 *Font) *Chart

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

func (chart *Chart) DrawOn(page *Page)

DrawOn draws chart chart on the specified page. @param page the page to draw chart chart on.

func (*Chart) DrawXAxisLabels

func (chart *Chart) DrawXAxisLabels(page *Page)

DrawXAxisLabels draws the X axis labels.

func (*Chart) DrawYAxisLabels

func (chart *Chart) DrawYAxisLabels(page *Page)

DrawYAxisLabels draws the Y axis labels.

func (*Chart) GetData

func (chart *Chart) GetData() [][]*Point

GetData returns the chart data.

func (*Chart) Intercept

func (chart *Chart) Intercept(points []*Point, slope float32) float32

Intercept calculates the intercept of a trend line given a list of points. See Example_09.

func (*Chart) SetData

func (chart *Chart) SetData(chartData [][]*Point)

SetData sets the data that will be used to draw chart chart.

func (*Chart) SetDrawXAxisLabels

func (chart *Chart) SetDrawXAxisLabels(drawXAxisLabels bool)

SetDrawXAxisLabels -- TODO:

func (*Chart) SetDrawXAxisLines

func (chart *Chart) SetDrawXAxisLines(drawXAxisLines bool)

SetDrawXAxisLines -- TODO:

func (*Chart) SetDrawYAxisLabels

func (chart *Chart) SetDrawYAxisLabels(drawYAxisLabels bool)

SetDrawYAxisLabels -- TODO:

func (*Chart) SetDrawYAxisLines

func (chart *Chart) SetDrawYAxisLines(drawYAxisLines bool)

SetDrawYAxisLines -- TODO:

func (*Chart) SetLocation

func (chart *Chart) SetLocation(x, y float32)

SetLocation sets the location of chart chart on the page.

func (*Chart) SetMaximumFractionDigits

func (chart *Chart) SetMaximumFractionDigits(maxFractionDigits int)

SetMaximumFractionDigits sets the maximum number of fractions digits do display for the X and Y axis labels.

func (*Chart) SetMinimumFractionDigits

func (chart *Chart) SetMinimumFractionDigits(minFractionDigits int)

SetMinimumFractionDigits sets the minimum number of fractions digits do display for the X and Y axis labels.

func (*Chart) SetSize

func (chart *Chart) SetSize(w, h float32)

SetSize sets the size of chart chart.

func (*Chart) SetTitle

func (chart *Chart) SetTitle(title string)

SetTitle sets the title of the chart.

func (*Chart) SetXAxisMinMax

func (chart *Chart) SetXAxisMinMax(xMin, xMax float32, xAxisGridLines int)

SetXAxisMinMax sets xMin and xMax for the X axis and the number of X grid lines.

func (*Chart) SetXAxisTitle

func (chart *Chart) SetXAxisTitle(title string)

SetXAxisTitle sets the title for the X axis.

func (*Chart) SetXYChart

func (chart *Chart) SetXYChart(xyChart bool)

SetXYChart -- TODO:

func (*Chart) SetYAxisMinMax

func (chart *Chart) SetYAxisMinMax(yMin, yMax float32, yAxisGridLines int)

SetYAxisMinMax sets yMin and yMax for the Y axis and the number of Y grid lines.

func (*Chart) SetYAxisTitle

func (chart *Chart) SetYAxisTitle(title string)

SetYAxisTitle sets the title for the Y axis.

func (*Chart) Slope

func (chart *Chart) Slope(points []*Point) float32

Slope calculates the slope of a trend line given a list of points. See Example_09.

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

func NewCheckBox(font *Font, label string) *CheckBox

NewCheckBox creates a CheckBox with black check mark.

func (*CheckBox) Check

func (checkBox *CheckBox) Check(mark int) *CheckBox

*

  • Checks or unchecks checkBox check box. See the Mark class for available options. *
  • @return checkBox CheckBox.

func (*CheckBox) DrawOn

func (checkBox *CheckBox) DrawOn(page Page) []float32

DrawOn draws checkBox CheckBox on the specified Page.

@param page the Page where the CheckBox is to be drawn.

func (*CheckBox) GetHeight

func (checkBox *CheckBox) GetHeight() float32

GetHeight gets the height of the CheckBox.

func (*CheckBox) GetWidth

func (checkBox *CheckBox) GetWidth() float32

GetWidth gets the width of the CheckBox.

func (*CheckBox) SetActualText

func (checkBox *CheckBox) SetActualText(actualText string) *CheckBox

SetActualText sets the actual text for checkBox check box. @param actualText the actual text for the check box. @return checkBox CheckBox.

func (*CheckBox) SetAltDescription

func (checkBox *CheckBox) SetAltDescription(altDescription string) *CheckBox

SetAltDescription sets the alternate description of checkBox check box. @param altDescription the alternate description of the check box. @return checkBox Checkbox.

func (*CheckBox) SetBoxColor

func (checkBox *CheckBox) SetBoxColor(boxColor int32) *CheckBox

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

func (checkBox *CheckBox) SetCheckmark(checkColor int32) *CheckBox

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

func (checkBox *CheckBox) SetFontSize(fontSize float32) *CheckBox

SetFontSize sets the font size to use for checkBox text line. @param fontSize the fontSize to use. @return checkBox CheckBox.

func (*CheckBox) SetLocation

func (checkBox *CheckBox) SetLocation(x, y float32) *CheckBox

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

func (checkBox *CheckBox) SetURIAction(uri *string) *CheckBox

SetURIAction sets the URI for the "click text line" action. @param uri the URI. @return checkBox CheckBox.

type Chunk

type Chunk struct {
	ChunkLength uint32
	ChunkType   []byte
	ChunkData   []byte
	ChunkCRC    uint32
}

Chunk is used by the pngimage module.

func NewChunk

func NewChunk() *Chunk

NewChunk construct new PNG chunk.

type CompositeTextLine

type CompositeTextLine struct {
	X int
	Y int
	// contains filtered or unexported fields
}

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, 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

func NewDimension(width, height float32) *Dimension

NewDimension Constructor for creating dimension objects.

@param width the width. @param height the height.

func (*Dimension) GetHeight

func (dimension *Dimension) GetHeight() float32

GetHeight gets the height of the component.

func (*Dimension) GetWidth

func (dimension *Dimension) GetWidth() float32

GetWidth gets the width of the component.

type DonutChart

type DonutChart struct {
	// contains filtered or unexported fields
}

DonutChart is used for donut chart objects.

func NewDonutChart

func NewDonutChart() *DonutChart

NewDonutChart creates donut chart object.

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

func NewEmbeddedFile(pdf *PDF, fileName string, reader io.Reader, compress bool) *EmbeddedFile

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 NewField

func NewField(x float32, values []string, format bool) *Field

NewField constructs field object.

func (*Field) SetActualText

func (field *Field) SetActualText(actualText string) *Field

SetActualText sets the alt description.

func (*Field) SetAltDescription

func (field *Field) SetAltDescription(altDescription string) *Field

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

func NewCJKFont(pdf *PDF, fontName string) *Font

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

func NewCoreFont(pdf *PDF, coreFont *corefont.CoreFont) *Font

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

func NewCoreFontForPDFobj(coreFont *corefont.CoreFont) *Font

NewCoreFontForPDFobj is the constructor used by PDFobj Core font should be interface!

func NewFont

func NewFont(pdf *PDF, reader io.Reader) *Font

NewFont constructs font object from OpenType and TrueType font.

func NewFontFromFile

func NewFontFromFile(pdf *PDF, filePath string) *Font

func NewFontStream1

func NewFontStream1(pdf *PDF, reader io.Reader) *Font

NewFontStream1 constructs font object from .ttf.stream and add it to the PDF

func NewFontStream2

func NewFontStream2(objects *[]*PDFobj, reader io.Reader) *Font

NewFontStream2 constructs font object from .ttf.stream and add it to the array of PDFobj

func (*Font) GetAscent

func (font *Font) GetAscent() float32

GetAscent returns the ascent of this font.

func (*Font) GetBodyHeight

func (font *Font) GetBodyHeight() float32

GetBodyHeight returns the height of the body of the font.

func (*Font) GetDescent

func (font *Font) GetDescent() float32

GetDescent returns the descent of this font.

func (*Font) GetFitChars

func (font *Font) GetFitChars(text string, width float32) int

GetFitChars returns the number of characters from the specified text string that will fit within the specified width.

func (*Font) GetHeight

func (font *Font) GetHeight() float32

GetHeight returns the height of this font.

func (*Font) GetSize

func (font *Font) GetSize() float32

GetSize returns the current font size.

func (*Font) SetItalic

func (font *Font) SetItalic(skew15 bool)

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

func (font *Font) SetKernPairs(kernPairs bool)

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.

func (*Font) SetSize

func (font *Font) SetSize(fontSize float32) *Font

SetSize sets the size of this font.

func (*Font) StringWidth

func (font *Font) StringWidth(fallbackFont *Font, text string) float32

StringWidth returns the width of text string drawn using main and fallback 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 NewForm

func NewForm(fields []*Field) *Form

NewForm constructs new form object.

func (*Form) DrawOn

func (form *Form) DrawOn(page *Page) []float32

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

func (form *Form) SetLabelColor(labelColor int32) *Form

SetLabelColor sets the color for the label.

func (*Form) SetLabelFont

func (form *Form) SetLabelFont(f1 *Font) *Form

SetLabelFont sets the font for the label text.

func (*Form) SetLabelFontSize

func (form *Form) SetLabelFontSize(labelFontSize float32) *Form

SetLabelFontSize sets the font size for the label text.

func (*Form) SetLocation

func (form *Form) SetLocation(x, y float32) *Form

SetLocation sets location x and y.

func (*Form) SetRowHeight

func (form *Form) SetRowHeight(rowHeight float32) *Form

SetRowHeight sets the height of the rows.

func (*Form) SetRowWidth

func (form *Form) SetRowWidth(rowWidth float32) *Form

SetRowWidth sets the row width.

func (*Form) SetValueColor

func (form *Form) SetValueColor(valueColor int32) *Form

SetValueColor sets the color for the value string.

func (*Form) SetValueFont

func (form *Form) SetValueFont(f2 *Font) *Form

SetValueFont sets the font for the value text.

func (*Form) SetValueFontSize

func (form *Form) SetValueFontSize(valueFontSize float32) *Form

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 NewGraphicsState

func NewGraphicsState() *GraphicsState

NewGraphicsState is the constructor.

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

func NewImage(pdf *PDF, reader io.Reader, imageType int) *Image

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

func NewImage2(objects *[]*PDFobj, reader io.Reader, imageType int) *Image

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 NewImageFromFile(pdf *PDF, filePath string) *Image

func NewImageFromPDFobj

func NewImageFromPDFobj(pdf *PDF, obj *PDFobj) *Image

NewImageFromPDFobj constructs new image from an existing PDF object.

func (*Image) DrawOn

func (image *Image) DrawOn(page *Page) [2]float32

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

func (image *Image) FlipUpsideDown(flipUpsideDown bool)

FlipUpsideDown flips the image upside down.

func (*Image) GetHeight

func (image *Image) GetHeight() float32

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

func (image *Image) GetWidth() float32

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

func (image *Image) PlaceIn(box *Box)

PlaceIn places this image in the specified box. @param box the specified box.

func (*Image) ResizeHeight

func (image *Image) ResizeHeight(height float32) *Image

ResizeHeight resizes the image to the specified height.

func (*Image) ResizeToFit

func (image *Image) ResizeToFit(page *Page, keepAspectRatio bool)

ResizeToFit resizes an image so it would fit on a page.

func (*Image) ResizeWidth

func (image *Image) ResizeWidth(width float32) *Image

ResizeWidth resizes the image to the specified width.

func (*Image) RotateClockwise

func (image *Image) RotateClockwise(degrees int)

SetRotate sets the image rotation to the specified number of degrees. @param degrees the number of degrees.

func (*Image) ScaleBy

func (image *Image) ScaleBy(factor float32) *Image

ScaleBy scales this image by the specified factor. @param factor the factor used to scale the image.

func (*Image) ScaleByWidthAndHeight

func (image *Image) ScaleByWidthAndHeight(widthFactor, heightFactor float32) *Image

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

func (image *Image) SetActualText(actualText string) *Image

SetActualText sets the actual text for this image. @param actualText the actual text for the image. @return this Image.

func (*Image) SetAltDescription

func (image *Image) SetAltDescription(altDescription string) *Image

SetAltDescription sets the alternate description of this image. @param altDescription the alternate description of the image. @return this Image.

func (*Image) SetGoToAction

func (image *Image) SetGoToAction(key *string)

SetGoToAction sets the destination key for the action. @param key the destination name.

func (*Image) SetLocation

func (image *Image) SetLocation(x, y float32) *Image

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

func (image *Image) SetPosition(x, y float32)

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

func (image *Image) SetURIAction(uri *string)

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 NewJPGImage

func NewJPGImage(reader io.Reader) *JPGImage

NewJPGImage is the constructor.

func (*JPGImage) GetColorComponents

func (image *JPGImage) GetColorComponents() uint8

GetColorComponents returns the color components of the image.

func (*JPGImage) GetData

func (image *JPGImage) GetData() []byte

GetData returns the image data.

func (*JPGImage) GetFileSize

func (image *JPGImage) GetFileSize() uint64

GetFileSize returns the file size of the image.

func (*JPGImage) GetHeight

func (image *JPGImage) GetHeight() float32

GetHeight returns the height of the image.

func (*JPGImage) GetWidth

func (image *JPGImage) GetWidth() float32

GetWidth returns the width 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

func NewLine(x1, y1, x2, y2 float32) *Line

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

func (line *Line) DrawOn(page *Page) [2]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 (*Line) GetCapStyle

func (line *Line) GetCapStyle() int

GetCapStyle returns the line cap style. @return the cap style.

func (*Line) GetEndPoint

func (line *Line) GetEndPoint() *Point

GetEndPoint returns the end point of this line. @return Point the point.

func (*Line) GetStartPoint

func (line *Line) GetStartPoint() *Point

GetStartPoint returns the start point of this line. @return Point the point.

func (*Line) PlaceIn

func (line *Line) PlaceIn(box *Box, xOffset, yOffset float32) *Line

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

func (line *Line) PlaceInBox(box *Box) *Line

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

func (line *Line) ScaleBy(factor float32) *Line

ScaleBy scales this line by the spacified factor.

@param factor the factor used to scale the line. @return this Line object.

func (*Line) SetActualText

func (line *Line) SetActualText(actualText string) *Line

SetActualText sets the actual text for this line. @param actualText the actual text for the line. @return this Line.

func (*Line) SetAltDescription

func (line *Line) SetAltDescription(altDescription string) *Line

SetAltDescription sets the alternate description of this line.

@param altDescription the alternate description of the line. @return this Line.

func (*Line) SetCapStyle

func (line *Line) SetCapStyle(style int) *Line

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

func (line *Line) SetColor(color int32) *Line

SetColor sets the color for this line. @param color the color specified as an integer. @return this Line object.

func (*Line) SetEndPoint

func (line *Line) SetEndPoint(x, y float32) *Line

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

func (line *Line) SetPattern(pattern string) *Line

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

func (line *Line) SetPointA(x, y float32) *Line

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

func (line *Line) SetPointB(x, y float32) *Line

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

func (line *Line) SetPosition(x, y float32)

SetPosition sets the start point of this line.

func (*Line) SetStartPoint

func (line *Line) SetStartPoint(x, y float32) *Line

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.

func (*Line) SetWidth

func (line *Line) SetWidth(width float32) *Line

SetWidth sets the width of this line. @param width the width. @return this Line object.

type OTF

type OTF struct {
	// contains filtered or unexported fields
}

OTF is used to construct TTF and OTF font objects.

func NewOTF

func NewOTF(reader io.Reader) *OTF

NewOTF is the constructor for TTF and OTF fonts.

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

func NewPDF(w *bufio.Writer, pdfCompliance int) *PDF

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 NewPDFFile(filePath string, pdfCompliance int) *PDF

func (*PDF) AddObjects

func (pdf *PDF) AddObjects(objects *[]*PDFobj)

AddObjects adds the specified objects to the PDF.

func (*PDF) AddPage

func (pdf *PDF) AddPage(page *Page)

AddPage adds page to the PDF.

func (*PDF) AddResourceObjects

func (pdf *PDF) AddResourceObjects(objects []*PDFobj)

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

func (pdf *PDF) GetPageObjects(objects []*PDFobj) []*PDFobj

GetPageObjects returns all page objects.

func (*PDF) Read

func (pdf *PDF) Read(buf []byte) []*PDFobj

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) SetAuthor

func (pdf *PDF) SetAuthor(author string)

SetAuthor sets the "Author" document property of the PDF file.

func (*PDF) SetCompliance

func (pdf *PDF) SetCompliance(compliance int)

func (*PDF) SetCreator

func (pdf *PDF) SetCreator(creator string)

SetCreator sets the creator field of the PDF.

func (*PDF) SetKeywords

func (pdf *PDF) SetKeywords(keywords string)

SetKeywords sets the keywords.

func (*PDF) SetLanguage

func (pdf *PDF) SetLanguage(language string)

SetLanguage sets the "Language" document property of the PDF file.

func (*PDF) SetPageLayout

func (pdf *PDF) SetPageLayout(pageLayout string)

SetPageLayout sets the page layout.

func (*PDF) SetPageMode

func (pdf *PDF) SetPageMode(pageMode string)

SetPageMode sets the page mode.

func (*PDF) SetSubject

func (pdf *PDF) SetSubject(subject string)

SetSubject sets the "Subject" document property of the PDF file.

func (*PDF) SetTitle

func (pdf *PDF) SetTitle(title string)

SetTitle sets the "Title" 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

func (obj *PDFobj) AddFontResource(font *Font, objects *[]*PDFobj)

AddFontResource adds font resource.

func (*PDFobj) AddImageResource

func (obj *PDFobj) AddImageResource(image *Image, objects *[]*PDFobj)

AddImageResource adds an image resource.

func (*PDFobj) GetContentsObject

func (obj *PDFobj) GetContentsObject(objects []*PDFobj) *PDFobj

GetContentsObject returns the contect object.

func (*PDFobj) GetData

func (obj *PDFobj) GetData() []byte

GetData returns the uncompressed stream data.

func (*PDFobj) GetDict

func (obj *PDFobj) GetDict() []string

GetDict returns the object dictionary.

func (*PDFobj) GetLength

func (obj *PDFobj) GetLength(objects []*PDFobj) int

GetLength return the length value.

func (*PDFobj) GetObjectNumbers

func (obj *PDFobj) GetObjectNumbers(key string) []int

GetObjectNumbers returns the object numbers.

func (*PDFobj) GetPageSize

func (obj *PDFobj) GetPageSize() [2]float32

GetPageSize returns the page size.

func (*PDFobj) SetGraphicsState

func (obj *PDFobj) SetGraphicsState(gs *GraphicsState, objects *[]*PDFobj)

SetGraphicsState sets the graphics state.

func (*PDFobj) SetNumber

func (obj *PDFobj) SetNumber(number int)

SetNumber sets the object number.

func (*PDFobj) SetStream

func (obj *PDFobj) SetStream(stream []byte)

SetStream sets the object stream.

func (*PDFobj) SetStreamAndData

func (obj *PDFobj) SetStreamAndData(buf []byte, length int)

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

func NewPNGImage(reader io.Reader) *PNGImage

NewPNGImage is used to embed PNG images in a PDF document.

func (*PNGImage) GetAlpha

func (image *PNGImage) GetAlpha() []byte

GetAlpha returns the image alpha data.

func (*PNGImage) GetBitDepth

func (image *PNGImage) GetBitDepth() int

GetBitDepth returns the bit depth of the image.

func (*PNGImage) GetColorType

func (image *PNGImage) GetColorType() int

GetColorType returns the color type of the image.

func (*PNGImage) GetData

func (image *PNGImage) GetData() []byte

GetData returns the image data.

func (*PNGImage) GetHeight

func (image *PNGImage) GetHeight() float32

GetHeight returns the height of the image.

func (*PNGImage) GetWidth

func (image *PNGImage) GetWidth() float32

GetWidth returns the width 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

func NewPage(pdf *PDF, pageSize [2]float32) *Page

*

  • 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 NewPageDetached(pdf *PDF, pageSize [2]float32) *Page

func NewPageFromObject

func NewPageFromObject(pdf *PDF, pageObj *PDFobj) *Page

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) AddBMC

func (page *Page) AddBMC(structure, language, actualText, altDescription string)

AddBMC adds BMC to the page.

func (*Page) AddCoreFontResource

func (page *Page) AddCoreFontResource(coreFont *corefont.CoreFont, objects *[]*PDFobj) *Font

AddCoreFontResource adds core font to the PDF objects.

func (*Page) AddDestination

func (page *Page) AddDestination(name *string, yPosition float32) *Destination

AddDestination adds destination to this page. @param name The destination name. @param yPosition The vertical position of the destination on this page.

func (*Page) AddEMC

func (page *Page) AddEMC()

AddEMC adds EMC to the page.

func (*Page) AddFontResource

func (page *Page) AddFontResource(font *Font, objects *[]*PDFobj)

AddFontResource adds font to the PDF objects.

func (*Page) AddFooter

func (page *Page) AddFooter(textLine *TextLine) []float32

AddFooter adds footer to this page.

func (*Page) AddFooterOffsetBy

func (page *Page) AddFooterOffsetBy(textLine *TextLine, offset float32) []float32

AddFooterOffsetBy adds footer to this page offset by the specified value.

func (*Page) AddHeader

func (page *Page) AddHeader(textLine *TextLine) []float32

AddHeader adds header to this page.

func (*Page) AddHeaderOffsetBy

func (page *Page) AddHeaderOffsetBy(textLine *TextLine, offset float32) []float32

AddHeaderOffsetBy adds header to this page offset by the specified value.

func (*Page) AddImageResource

func (page *Page) AddImageResource(image *Image, objects *[]*PDFobj)

AddImageResource adds an image to the PDF objects.

func (*Page) AddWatermark

func (page *Page) AddWatermark(font *Font, text string)

AddWatermark add watermark to the page.

func (*Page) BeginText

func (page *Page) BeginText()

BeginText begins text block.

func (*Page) BezierCurveTo

func (page *Page) BezierCurveTo(p1, p2, p3 *Point)

*

  • 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) ClipPath

func (page *Page) ClipPath()

clipPath clips the path.

func (*Page) ClipRect

func (page *Page) ClipRect(x, y, w, h float32)

func (*Page) ClosePath

func (page *Page) ClosePath()

ClosePath closes the path and draws it using the current pen color.

func (*Page) Complete

func (page *Page) Complete(objects *[]*PDFobj)

Complete completes adding content to the existing PDF.

func (*Page) CurveTo

func (page *Page) CurveTo(x1, y1, x2, y2, x3, y3 float32)

*

  • 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

func (page *Page) DrawArrayOfCharacters(font *Font, text string, x, y, dx float32)

DrawArrayOfCharacters draws array of equally spaced characters.

func (*Page) DrawCircle

func (page *Page) DrawCircle(x, y, r float32)

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

func (page *Page) DrawEllipse(x, y, r1, r2 float32)

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

func (page *Page) DrawLine(x1, y1, x2, y2 float32)

DrawLine draws a line on the page, using the current color, between the points (x1, y1) and (x2, y2).

func (*Page) DrawPath

func (page *Page) DrawPath(path []*Point, operation string)

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

func (page *Page) DrawPoint(p *Point)

DrawPoint draws a point on the page using the current pen color. @param p the point.

func (*Page) DrawRect

func (page *Page) DrawRect(x, y, w, h float32)

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

func (page *Page) DrawRectRoundCorners(x, y, w, h, r1, r2 float32, operation string)

DrawRectRoundCorners draws rectangle with rounded corners. Code provided by: Dominique Andre Gunia <contact@dgunia.de>

func (*Page) DrawString

func (page *Page) DrawString(font1 *Font, font2 *Font, text string, x, y float32)

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) DrawText

func (page *Page) DrawText(str string)

func (*Page) EndText

func (page *Page) EndText()

EndText ends text block.

func (*Page) FillCircle

func (page *Page) FillCircle(x, y, r float32)

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

func (page *Page) FillEllipse(x, y, r1, r2 float32)

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

func (page *Page) FillRect(x, y, w, h float32)

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

func (page *Page) GetBrushColor() [3]float32

GetBrushColor returns the brush color. @return the brush color.

func (*Page) GetHeight

func (page *Page) GetHeight() float32

GetHeight returns the height of this page.

func (*Page) GetPenColor

func (page *Page) GetPenColor() [3]float32

func (*Page) GetWidth

func (page *Page) GetWidth() float32

GetWidth returns the width of this page.

func (*Page) InvertYAxis

func (page *Page) InvertYAxis()

InvertYAxis inverts the Y axis.

func (*Page) LineTo

func (page *Page) LineTo(x, y float32)

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

func (page *Page) MoveTo(x, y float32)

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) NextLine

func (page *Page) NextLine()

func (*Page) Restore

func (page *Page) Restore()

func (*Page) Save

func (page *Page) Save()

func (*Page) SetArtBox

func (page *Page) SetArtBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)

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

func (page *Page) SetBleedBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)

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

func (page *Page) SetBrushColor(color int32)

SetBrushColor sets the brush color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.

func (*Page) SetBrushColorCMYK

func (page *Page) SetBrushColorCMYK(c, m, y, k float32)

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

func (page *Page) SetBrushColorRGB(r, g, b float32)

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

func (page *Page) SetColorCMYK(c, m, y, k float32)

SetColorCMYK sets the CMYK color.

func (*Page) SetColorRGB

func (page *Page) SetColorRGB(r, g, b float32)

SetColorRGB sets the RGB color.

func (*Page) SetCropBox

func (page *Page) SetCropBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)

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

func (page *Page) SetLineCapStyle(style int)

SetLineCapStyle sets the current line cap style. Supported values: Cap.BUTT, Cap.ROUND and Cap.PROJECTING_SQUARE

func (*Page) SetLineJoinStyle

func (page *Page) SetLineJoinStyle(style int)

SetLineJoinStyle sets the line join style. Supported values: Join.MITER, Join.ROUND and Join.BEVEL

func (*Page) SetLinePattern

func (page *Page) SetLinePattern(pattern string)

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

func (page *Page) SetPenColor(color int32)

SetPenColor sets the pen color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.

func (*Page) SetPenColorCMYK

func (page *Page) SetPenColorCMYK(c, m, y, k float32)

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

func (page *Page) SetPenColorRGB(r, g, b float32)

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

func (page *Page) SetPenWidth(width float32)

SetPenWidth sets the pen width that will be used to draw lines and splines on this page.

func (*Page) SetTextDirection

func (page *Page) SetTextDirection(degrees int)

SetTextDirection sets the text direction. @param degrees the angle.

func (*Page) SetTextFont

func (page *Page) SetTextFont(font *Font)

SetTextFont sets the text fonts.

func (*Page) SetTextLeading

func (page *Page) SetTextLeading(leading float32)

func (*Page) SetTextLocation

func (page *Page) SetTextLocation(x, y float32)

func (*Page) SetTextRenderingMode

func (page *Page) SetTextRenderingMode(mode int)

*

  • Sets the text rendering mode. *
  • @param mode the rendering mode.

func (*Page) SetTextRise

func (page *Page) SetTextRise(rise float32)

func (*Page) SetTextScaling

func (page *Page) SetTextScaling(scaling float32)

func (*Page) SetTrimBox

func (page *Page) SetTrimBox(upperLeftX, upperLeftY, lowerRightX, lowerRightY float32)

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.

func (*Page) Transform

func (page *Page) Transform(values []float32)

Transformation matrix. Use save before, restore afterwards! 9 value array like generated by androids Matrix.getValues()

type Paragraph

type Paragraph struct {
	// contains filtered or unexported fields
}

Paragraph describes paragraph objects. See the TextColumn class for more information.

func NewParagraph

func NewParagraph() *Paragraph

NewParagraph constructor paragraph objects.

func ParagraphsFromFile

func ParagraphsFromFile(f1 *Font, filePath string) []*Paragraph

func (*Paragraph) Add

func (paragraph *Paragraph) Add(textLine *TextLine) *Paragraph

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 *Paragraph) GetTextLines() []*TextLine

func (*Paragraph) GetTextX

func (paragraph *Paragraph) GetTextX() float32

func (*Paragraph) GetTextY

func (paragraph *Paragraph) GetTextY() float32

func (*Paragraph) GetX1

func (paragraph *Paragraph) GetX1() float32

func (*Paragraph) GetX2

func (paragraph *Paragraph) GetX2() float32

func (*Paragraph) GetY1

func (paragraph *Paragraph) GetY1() float32

func (*Paragraph) GetY2

func (paragraph *Paragraph) GetY2() float32

func (*Paragraph) SetAlignment

func (paragraph *Paragraph) SetAlignment(alignment int) *Paragraph

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) SetColor

func (paragraph *Paragraph) SetColor(color int32)

func (*Paragraph) SetColorMap

func (paragraph *Paragraph) SetColorMap(colorMap map[string]int32)

func (*Paragraph) StartsWith

func (paragraph *Paragraph) StartsWith(token string) bool

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 NewPath

func NewPath() *Path

NewPath - the default constructor.

func (*Path) Add

func (path *Path) Add(point *Point)

Add adds a point to this path. @param point the point to add.

func (*Path) DrawOn

func (path *Path) DrawOn(page *Page) []float32

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

func (path *Path) GetLineCapStyle() int

GetLineCapStyle returns the line cap style for this path. @return the line cap style for this path.

func (*Path) GetLineJoinStyle

func (path *Path) GetLineJoinStyle() int

GetLineJoinStyle returns the line join style.

func (*Path) PlaceAtZeroZeroIn

func (path *Path) PlaceAtZeroZeroIn(box *Box)

PlaceAtZeroZeroIn places this path in the specified box at position (0.0, 0.0).

func (*Path) PlaceIn

func (path *Path) PlaceIn(box *Box, xOffset, yOffset float32)

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) ScaleBy

func (path *Path) ScaleBy(factor float32)

ScaleBy scales the path using the specified factor.

func (*Path) SetClosePath

func (path *Path) SetClosePath(closePath bool)

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

func (path *Path) SetColor(color int32)

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

func (path *Path) SetFillShape(fillShape bool)

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

func (path *Path) SetLineCapStyle(style int)

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

func (path *Path) SetLineJoinStyle(style int)

SetLineJoinStyle sets the line join style. Supported values: Join.MITER, Join.ROUND and Join.BEVEL

func (*Path) SetLocation

func (path *Path) SetLocation(x, y float32)

SetLocation sets the location of the path.

func (*Path) SetPattern

func (path *Path) SetPattern(pattern string)

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.

func (*Path) SetWidth

func (path *Path) SetWidth(width float32)

SetWidth sets the pen width that will be used to draw the lines and splines that are part of this path. @param width the pen width.

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 NewPathOp

func NewPathOp(cmd rune) *PathOp

func NewPathOpXY

func NewPathOpXY(cmd rune, x, y float32) *PathOp

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

func GetCurvePoints(x, y, r1, r2 float32, segment int) []*Point

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

func NewControlPoint(x, y float32) *Point

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

func NewPoint(x, y float32) *Point

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

func (point *Point) DrawOn(page *Page) []float32

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

func (point *Point) GetAlignment() int

GetAlignment returns the point alignment. @return align the alignment value.

func (*Point) GetColor

func (point *Point) GetColor() int32

GetColor returns the point color as an integer. @return the color.

func (*Point) GetFillShape

func (point *Point) GetFillShape() bool

GetFillShape returns the value of the fillShape private variable. @return the value of the private fillShape variable.

func (*Point) GetLinePattern

func (point *Point) GetLinePattern() string

GetLinePattern returns the line dash pattern. @return the line dash pattern.

func (*Point) GetLineWidth

func (point *Point) GetLineWidth() float32

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

func (point *Point) GetRadius() float32

GetRadius returns the radius of this point. @return the radius of this point.

func (*Point) GetShape

func (point *Point) GetShape() int

GetShape returns the point shape code value. @return the shape code value.

func (*Point) GetText

func (point *Point) GetText() string

GetText returns the text associated with this point. @return the text.

func (*Point) GetTextColor

func (point *Point) GetTextColor() int32

GetTextColor returns the point's text color. @return the text color.

func (*Point) GetTextDirection

func (point *Point) GetTextDirection() int

GetTextDirection returns the point's text direction. @return the text direction.

func (*Point) GetURIAction

func (point *Point) GetURIAction() *string

GetURIAction returns the URI for the "click point" action. @return the URI for the "click point" action.

func (*Point) GetX

func (point *Point) GetX() float32

GetX returns the x coordinate of this point. @return the x coordinate of this point.

func (*Point) GetY

func (point *Point) GetY() float32

GetY returns the y coordinate of this point. @return the y coordinate of this point.

func (*Point) PlaceAtZeroZeroIn

func (point *Point) PlaceAtZeroZeroIn(box *Box)

PlaceAtZeroZeroIn places this point in the specified box at position (0f, 0f). @param box the specified box.

func (*Point) PlaceIn

func (point *Point) PlaceIn(box *Box, xOffset, yOffset float32)

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

func (point *Point) SetAlignment(align int)

SetAlignment sets the point alignment inside table cell. @param align the alignment value.

func (*Point) SetColor

func (point *Point) SetColor(color int32) *Point

SetColor sets the pen color for this point. @param color the color specified as an integer.

func (*Point) SetDrawPath

func (point *Point) SetDrawPath() *Point

SetDrawPath sets this point as the start of a path that will be drawn on the chart.

func (*Point) SetFillShape

func (point *Point) SetFillShape(fillShape bool)

SetFillShape sets the private fillShape variable. @param fillShape if true - fill the point with the specified brush color.

func (*Point) SetLinePattern

func (point *Point) SetLinePattern(linePattern string)

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

func (point *Point) SetLineWidth(lineWidth float32) *Point

SetLineWidth sets the width of the lines of this point. @param lineWidth the line width.

func (*Point) SetLocation

func (point *Point) SetLocation(x, y float32)

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) SetRadius

func (point *Point) SetRadius(r float32)

SetRadius sets the radius of this point. @param r the radius.

func (*Point) SetShape

func (point *Point) SetShape(shape int) *Point

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) SetText

func (point *Point) SetText(text string)

SetText sets the point text. @param text the text.

func (*Point) SetTextColor

func (point *Point) SetTextColor(textColor int32)

SetTextColor sets the point's text color. @param textColor the text color.

func (*Point) SetTextDirection

func (point *Point) SetTextDirection(textDirection int)

SetTextDirection sets the point's text direction. @param textDirection the text direction.

func (*Point) SetURIAction

func (point *Point) SetURIAction(uri *string)

SetURIAction sets the URI for the "click point" action. @param uri the URI

func (*Point) SetX

func (point *Point) SetX(x float32)

SetX sets the x coordinate of this point. @param x the x coordinate of this point when drawn on the page.

func (*Point) SetY

func (point *Point) SetY(y float32)

SetY sets the y coordinate of this point. @param y the y coordinate of this point when drawn on the page.

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.

func NewRound

func NewRound() *Round

NewRound constructor.

type SVG

type SVG struct {
}

func NewSVG

func NewSVG() *SVG

func (*SVG) GetOperations

func (svg *SVG) GetOperations(path string) []*PathOp

func (*SVG) ToPDF

func (svg *SVG) ToPDF(list []*PathOp) []*PathOp

type SVGImage

type SVGImage struct {
	// contains filtered or unexported fields
}

func NewSVGImage

func NewSVGImage(reader io.Reader) *SVGImage

*

  • Used to embed SVG images in the PDF document. *
  • @param stream the input stream.

func NewSVGImageFromFile

func NewSVGImageFromFile(filePath string) *SVGImage

func (*SVGImage) DrawOn

func (image *SVGImage) DrawOn(page *Page) []float32

func (*SVGImage) GetHeight

func (image *SVGImage) GetHeight() float32

func (*SVGImage) GetWidth

func (image *SVGImage) GetWidth() float32

func (*SVGImage) ScaleBy

func (image *SVGImage) ScaleBy(factor float32)

func (*SVGImage) SetLocation

func (image *SVGImage) SetLocation(x, y float32)

type SVGPath

type SVGPath struct {
	// contains filtered or unexported fields
}

func NewSVGPath

func NewSVGPath() *SVGPath

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice(percent float32, color int32) *Slice

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) GetBrush

func (state *State) GetBrush() [3]float32

GetBrush returns the brush.

func (*State) GetLineCapStyle

func (state *State) GetLineCapStyle() int

GetLineCapStyle returns the line cap style.

func (*State) GetLineJoinStyle

func (state *State) GetLineJoinStyle() int

GetLineJoinStyle returns the line join style.

func (*State) GetLinePattern

func (state *State) GetLinePattern() string

GetLinePattern returns the line pattern.

func (*State) GetPen

func (state *State) GetPen() [3]float32

GetPen returns the pen.

func (*State) GetPenWidth

func (state *State) GetPenWidth() float32

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 NewStructElem

func NewStructElem() *StructElem

NewStructElem constructor

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 NewTable

func NewTable() *Table

NewTable creates table objects.

func NewTableFromFile

func NewTableFromFile(f1, f2 *Font, fileName string) *Table

func (*Table) DrawOn

func (table *Table) DrawOn(page *Page) [2]float32

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

func (table *Table) DrawOnPages(pdf *PDF, pages *[]*Page, pageSize [2]float32) [2]float32

DrawOnPages draws the table on pdf pages with the specified size.

func (*Table) GetCellAt

func (table *Table) GetCellAt(rowIndex, colIndex int) *Cell

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

func (table *Table) GetCellAtRowColumn(rowIndex, colIndex int) *Cell

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

func (table *Table) GetColumn(index int) []*Cell

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

func (table *Table) GetColumnAtIndex(index int) []*Cell

GetColumnAtIndex return the column at the specified index.

func (*Table) GetColumnWidth

func (table *Table) GetColumnWidth(index int) float32

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

func (table *Table) GetRow(index int) []*Cell

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

func (table *Table) GetRowAtIndex(index int) []*Cell

GetRowAtIndex returns the row at the specified index.

func (*Table) GetRowsRendered

func (table *Table) GetRowsRendered() int

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

func (table *Table) GetWidth() float32

GetWidth returns the width of table table when drawn on a page. @return the widht of table table.

func (*Table) RemoveLineBetweenRows

func (table *Table) RemoveLineBetweenRows(index1, index2 int)

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

func (table *Table) SetBottomMargin(bottomMargin float32)

SetBottomMargin sets the bottom margin for table. @param bottomMargin the margin.

func (*Table) SetCellBorders

func (table *Table) SetCellBorders(borders bool)

SetNoCellBorders sets all table cells borders to <strong>false</strong> or <strong>true</strong>.

func (*Table) SetCellBordersColor

func (table *Table) SetCellBordersColor(color int32)

SetCellBordersColor sets the color of the cell border lines. @param color the color of the cell border lines.

func (*Table) SetCellBordersWidth

func (table *Table) SetCellBordersWidth(width float32)

SetCellBordersWidth sets the width of the cell border lines. @param width the width of the border lines.

func (*Table) SetColumnWidth

func (table *Table) SetColumnWidth(index int, width float32)

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

func (table *Table) SetData(tableData [][]*Cell, numOfHeaderRows int)

SetData sets the table data and specifies the number of header rows in table data.

func (*Table) SetFirstPageTopMargin

func (table *Table) SetFirstPageTopMargin(topMargin float32)

SetFirstPageTopMargin -- TODO:

func (*Table) SetFontInColumn

func (table *Table) SetFontInColumn(index int, font *Font)

SetFontInColumn sets the font for the specified column. @param index the column index. @param font the font.

func (*Table) SetFontInRow

func (table *Table) SetFontInRow(index int, font *Font)

SetFontInRow sets the font for the specified row. @param index the row index. @param font the font.

func (*Table) SetLocation

func (table *Table) SetLocation(x, y float32)

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) SetTextAlignInColumn

func (table *Table) SetTextAlignInColumn(index, alignment int)

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

func (table *Table) SetTextColorInColumn(index int, color int32)

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

func (table *Table) SetTextColorInRow(index, color int32)

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.

type Text

type Text struct {
	// contains filtered or unexported fields
}

Text structure Please see Example_45

func NewText

func NewText(paragraphs []*Paragraph) *Text

NewText is the constructor.

func (*Text) DrawOn

func (text *Text) DrawOn(page *Page) [2]float32

DrawOn draws the text on the page.

func (*Text) GetSize

func (text *Text) GetSize() [2]float32

GetSize returns the size of the text block.

func (*Text) SetBorder

func (text *Text) SetBorder(border bool)

func (*Text) SetLeading

func (text *Text) SetLeading(leading float32) *Text

SetLeading sets the leading of the text.

func (*Text) SetLocation

func (text *Text) SetLocation(x, y float32) *Text

SetLocation sets the location of the text.

func (*Text) SetParagraphLeading

func (text *Text) SetParagraphLeading(paragraphLeading float32) *Text

SetParagraphLeading sets the paragraph leading.

func (*Text) SetSpaceBetweenTextLines

func (text *Text) SetSpaceBetweenTextLines(spaceBetweenTextLines float32) *Text

SetSpaceBetweenTextLines sets the space between text lines.

func (*Text) SetWidth

func (text *Text) SetWidth(width float32) *Text

SetWidth sets the width of the text component.

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 NewTextBox

func NewTextBox(font *Font) *TextBox

NewTextBox creates a text box and sets the font.

@param font the font.

func (*TextBox) DrawOn

func (textBox *TextBox) DrawOn(page *Page) [2]float32

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

func (textBox *TextBox) GetBgColor() int32

GetBgColor returns the background color. @return int the color as 0xRRGGBB integer.

func (*TextBox) GetBorder

func (textBox *TextBox) GetBorder(value int) bool

GetBorder returns the text box border property values. @return boolean true if the specific border property value is set.

func (*TextBox) GetBrushColor

func (textBox *TextBox) GetBrushColor() int32

GetBrushColor returns the brush color. @return int the brush color specified as 0xRRGGBB integer.

func (*TextBox) GetFallbackFont

func (textBox *TextBox) GetFallbackFont() *Font

GetFallbackFont returns the fallback font.

func (*TextBox) GetFont

func (textBox *TextBox) GetFont() *Font

GetFont returns the font used by textBox text box. @return the font.

func (*TextBox) GetHeight

func (textBox *TextBox) GetHeight() float32

GetHeight returns the text box height. @return the text box height.

func (*TextBox) GetLineWidth

func (textBox *TextBox) GetLineWidth() float32

GetLineWidth returns the border line width. @return float the line width.

func (*TextBox) GetLocation

func (textBox *TextBox) GetLocation() [2]float32

GetLocation gets the location where textBox text box will be drawn on the page.

func (*TextBox) GetMargin

func (textBox *TextBox) GetMargin() float32

GetMargin returns the text box margin. @return the margin between the text and the box

func (*TextBox) GetPenColor

func (textBox *TextBox) GetPenColor() int32

GetPenColor returns the pen color as 0xRRGGBB integer. @return int the pen color.

func (*TextBox) GetSpacing

func (textBox *TextBox) GetSpacing() float32

GetSpacing returns the spacing between lines of text. @return float the spacing.

func (*TextBox) GetStrikeout

func (textBox *TextBox) GetStrikeout() bool

GetStrikeout returns the strikeout flag.

func (*TextBox) GetText

func (textBox *TextBox) GetText() string

GetText returns the text box text. @return the text box text.

func (*TextBox) GetTextAlignment

func (textBox *TextBox) GetTextAlignment() int

GetTextAlignment returns the text alignment. @return alignment the alignment code. Supported values: align.Left, align.Right and align.Center

func (*TextBox) GetTextColors

func (textBox *TextBox) GetTextColors() map[string]int32

GetTextColors returns the text colors map.

func (*TextBox) GetUnderline

func (textBox *TextBox) GetUnderline() bool

GetUnderline returns underlined flag.

func (*TextBox) GetVerticalAlignment

func (textBox *TextBox) GetVerticalAlignment() int

GetVerticalAlignment returns the vertical alignment setting.

func (*TextBox) GetWidth

func (textBox *TextBox) GetWidth() float32

GetWidth returns the text box width. @return the text box width.

func (*TextBox) GetX

func (textBox *TextBox) GetX() float32

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

func (textBox *TextBox) GetY() float32

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

func (textBox *TextBox) SetBgColor(color int32)

SetBgColor sets the background to the specified color. @param color the color specified as 0xRRGGBB integer.

func (*TextBox) SetBgColorRGB

func (textBox *TextBox) SetBgColorRGB(color []int32)

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

func (textBox *TextBox) SetBorder(border int)

SetBorder sets the TextBox border properties. @param border the border properties.

func (*TextBox) SetBorders

func (textBox *TextBox) SetBorders(borders bool)

SetBorder sets all the TextBox borders. @param borders sets all borders if true, no borders otherwise.

func (*TextBox) SetBrushColor

func (textBox *TextBox) SetBrushColor(color int32)

Sets the brush color. @param color the color specified as 0xRRGGBB integer.

func (*TextBox) SetBrushColorRGB

func (textBox *TextBox) SetBrushColorRGB(color []int32)

SetBrushColor sets the brush color. @param color the color specified as an array of int values from 0x00 to 0xFF.

func (*TextBox) SetFallbackFont

func (textBox *TextBox) SetFallbackFont(font *Font)

SetFallbackFont sets the fallback font.

func (*TextBox) SetFgColor

func (textBox *TextBox) SetFgColor(color int32)

Sets the pen and brush colors to the specified color. @param color the color specified as 0xRRGGBB integer.

func (*TextBox) SetFgColorRGB

func (textBox *TextBox) SetFgColorRGB(color []int32)

SetFgColor sets the pen and brush colors to the specified color using RGB values. @param color the color specified as 0xRRGGBB integer.

func (*TextBox) SetFont

func (textBox *TextBox) SetFont(font *Font)

SetFont sets the font for textBox text box.

@param font the font.

func (*TextBox) SetHeight

func (textBox *TextBox) SetHeight(height float32)

SetHeight sets the height of textBox text box. @param height the specified height.

func (*TextBox) SetLineWidth

func (textBox *TextBox) SetLineWidth(lineWidth float32)

SetLineWidth sets the border line width. @param lineWidth float

func (*TextBox) SetLocation

func (textBox *TextBox) SetLocation(x, y float32)

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

func (textBox *TextBox) SetMargin(margin float32)

SetMargin sets the margin of textBox text box. @param margin the margin between the text and the box

func (*TextBox) SetPenColor

func (textBox *TextBox) SetPenColor(color int32)

Sets the pen color. @param color the color specified as 0xRRGGBB integer.

func (*TextBox) SetPenColorRGB

func (textBox *TextBox) SetPenColorRGB(color []int32)

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

func (textBox *TextBox) SetPosition(x, y float32)

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

func (textBox *TextBox) SetSpacing(spacing float32)

SetSpacing sets the spacing between lines of text. @param spacing

func (*TextBox) SetStrikeout

func (textBox *TextBox) SetStrikeout(strikeout bool)

SetStrikeout sets the srikeout flag. In the flag is true - draw strikeout line through the text.

func (*TextBox) SetText

func (textBox *TextBox) SetText(text string)

SetText sets the text box text. @param text the text box text.

func (*TextBox) SetTextAlignment

func (textBox *TextBox) SetTextAlignment(alignment int)

SetTextAlignment sets the cell text alignment. @param alignment the alignment code. Supported values: align.Left, align.Right and align.Center

func (*TextBox) SetTextColors

func (textBox *TextBox) SetTextColors(colors map[string]int32)

SetTextColors sets the text colors map.

func (*TextBox) SetTextDirection

func (textBox *TextBox) SetTextDirection(textDirection int)

func (*TextBox) SetURIAction

func (textBlock *TextBox) SetURIAction(uri string) *TextBox

SetURIAction -- TODO:

func (*TextBox) SetUnderline

func (textBox *TextBox) SetUnderline(underline bool)

SetUnderline sets the underline variable. If the value of the underline variable is 'true' - the text is underlined.

func (*TextBox) SetVerticalAlignment

func (textBox *TextBox) SetVerticalAlignment(valign int)

SetVerticalAlignment sets the vertical alignment of the text in textBox TextBox. Valid values are align.Top, align.Bottom and align.Center

func (*TextBox) SetWidth

func (textBox *TextBox) SetWidth(width float32)

SetWidth sets the width of textBox text box.

@param width the specified width.

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

func NewTextFrame(paragraphs []*TextLine) *TextFrame

NewTextFrame constructs new text frame.

func (*TextFrame) DrawBorder

func (frame *TextFrame) DrawBorder(page *Page)

func (*TextFrame) DrawOn

func (frame *TextFrame) DrawOn(page *Page) []float32

DrawOn draws the text frame on the page.

func (*TextFrame) GetBeginParagraphPoints

func (frame *TextFrame) GetBeginParagraphPoints() [][]float32

GetBeginParagraphPoints returns the begin paragraph points.

func (*TextFrame) GetParagraphs

func (frame *TextFrame) GetParagraphs() []*TextLine

GetParagraphs returns the paragraphs.

func (*TextFrame) IsNotEmpty

func (frame *TextFrame) IsNotEmpty() bool

IsNotEmpty returns true if there is more text to draw, otherwise it returns false.

func (*TextFrame) SetDrawBorder

func (frame *TextFrame) SetDrawBorder(border bool)

SetDrawBorder sets the 'set border' variable.

func (*TextFrame) SetHeight

func (frame *TextFrame) SetHeight(h float32) *TextFrame

SetHeight sets the height of the frame.

func (*TextFrame) SetLeading

func (frame *TextFrame) SetLeading(leading float32) *TextFrame

SetLeading sets the text lines leading.

func (*TextFrame) SetLocation

func (frame *TextFrame) SetLocation(x, y float32) *TextFrame

SetLocation sets the location of the frame on the page.

func (*TextFrame) SetParagraphLeading

func (frame *TextFrame) SetParagraphLeading(paragraphLeading float32) *TextFrame

SetParagraphLeading sets the paragraph leading.

func (*TextFrame) SetPosition

func (frame *TextFrame) SetPosition(x, y float32)

SetPosition sets the position of the text frame on the page.

func (*TextFrame) SetSpaceBetweenTextLines

func (frame *TextFrame) SetSpaceBetweenTextLines(spaceBetweenTextLines float32) *TextFrame

SetSpaceBetweenTextLines sets the space between the text lines.

func (*TextFrame) SetWidth

func (frame *TextFrame) SetWidth(w float32) *TextFrame

SetWidth sets the width of the frame.

type TextLine

type TextLine struct {
	// contains filtered or unexported fields
}

TextLine is used to create text line objects.

func NewEmptyTextLine

func NewEmptyTextLine(font *Font) *TextLine

NewTextLine is constructor for creating empty text line objects. @param font the font to use.

func NewTextLine

func NewTextLine(font *Font, text string) *TextLine

NewTextLine is constructor for creating text line objects. @param font the font to use. @param text the text.

func (*TextLine) DrawOn

func (textLine *TextLine) DrawOn(page *Page) []float32

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

func (textLine *TextLine) GetActualText() string

GetActualText gets the actual text.

func (*TextLine) GetAltDescription

func (textLine *TextLine) GetAltDescription() string

GetAltDescription gets the alternate description of this text line.

func (*TextLine) GetColor

func (textLine *TextLine) GetColor() int32

GetColor returns the text line color. @return the text line color.

func (*TextLine) GetColorMap

func (textLine *TextLine) GetColorMap() map[string]int32

func (*TextLine) GetDestinationY

func (textLine *TextLine) GetDestinationY() float32

GetDestinationY returns the y coordinate of the destination. @return the y coordinate of the destination.

func (*TextLine) GetFallbackFont

func (textLine *TextLine) GetFallbackFont() *Font

GetFallbackFont returns the fallback font. @return the fallback font.

func (*TextLine) GetFont

func (textLine *TextLine) GetFont() *Font

GetFont gets the font to use for this text line. @return font the font to use.

func (*TextLine) GetGoToAction

func (textLine *TextLine) GetGoToAction() *string

GetGoToAction returns the GoTo action string. @return the GoTo action string.

func (*TextLine) GetHeight

func (textLine *TextLine) GetHeight() float32

GetHeight returns the height of this TextLine. @return the height.

func (*TextLine) GetLanguage

func (textLine *TextLine) GetLanguage() string

GetLanguage gets the language.

func (*TextLine) GetStrikeout

func (textLine *TextLine) GetStrikeout() bool

GetStrikeout returns the strikeout flag. @return the strikeout flag.

func (*TextLine) GetStringWidth

func (textLine *TextLine) GetStringWidth(text string) float32

GetWidth returns the width of this TextLine. @return the width.

func (*TextLine) GetText

func (textLine *TextLine) GetText() string

GetText returns the text.

func (*TextLine) GetTextDirection

func (textLine *TextLine) GetTextDirection() int

GetTextDirection returns the text direction. @return the text direction.

func (*TextLine) GetTextEffect

func (textLine *TextLine) GetTextEffect() int

GetTextEffect returns the text effect. @return the text effect.

func (*TextLine) GetTrailingSpace

func (textLine *TextLine) GetTrailingSpace() bool

GetTrailingSpace returns the trailing space. @return the trailing space.

func (*TextLine) GetURIAction

func (textLine *TextLine) GetURIAction() *string

GetURIAction returns the action URI. @return the action URI.

func (*TextLine) GetUnderline

func (textLine *TextLine) GetUnderline() bool

GetUnderline returns the underline flag. @return the underline flag.

func (*TextLine) GetVerticalOffset

func (textLine *TextLine) GetVerticalOffset() float32

GetVerticalOffset returns the vertical text offset. @return the vertical text offset.

func (*TextLine) GetWidth

func (textLine *TextLine) GetWidth() float32

GetWidth returns the width of this TextLine. @return the width.

func (*TextLine) PlaceIn

func (textLine *TextLine) PlaceIn(box *Box, xOffset, yOffset float32) *TextLine

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

func (textLine *TextLine) PlaceInAtZeroZero(box *Box) *TextLine

PlaceInAtZeroZero places this text line in the specified box at location (0.0, 0.0)

func (*TextLine) SetActualText

func (textLine *TextLine) SetActualText(actualText string) *TextLine

SetActualText sets the actual text for this text line. @param actualText the actual text for the text line. @return this TextLine.

func (*TextLine) SetAltDescription

func (textLine *TextLine) SetAltDescription(altDescription string) *TextLine

SetAltDescription sets the alternate description of this text line. @param altDescription the alternate description of the text line. @return this TextLine.

func (*TextLine) SetColor

func (textLine *TextLine) SetColor(color int32) *TextLine

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 *TextLine) SetColorMap(colorMap map[string]int32)

func (*TextLine) SetColorRGB

func (textLine *TextLine) SetColorRGB(color []int32) *TextLine

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

func (textLine *TextLine) SetFallbackFont(fallbackFont *Font) *TextLine

SetFallbackFont sets the fallback font. @param fallbackFont the fallback font. @return this TextLine.

func (*TextLine) SetFallbackFontSize

func (textLine *TextLine) SetFallbackFontSize(fallbackFontSize float32) *TextLine

SetFallbackFontSize sets the fallback font size to use for this text line. @param fallbackFontSize the fallback font size. @return this TextLine.

func (*TextLine) SetFont

func (textLine *TextLine) SetFont(font *Font) *TextLine

SetFont sets the font to use for this text line. @param font the font to use. @return this TextLine.

func (*TextLine) SetFontSize

func (textLine *TextLine) SetFontSize(fontSize float32) *TextLine

SetFontSize sets the font size to use for this text line. @param fontSize the fontSize to use. @return this TextLine.

func (*TextLine) SetGoToAction

func (textLine *TextLine) SetGoToAction(key *string) *TextLine

SetGoToAction sets the destination key for the action. @param key the destination name. @return this TextLine.

func (*TextLine) SetLanguage

func (textLine *TextLine) SetLanguage(language string) *TextLine

SetLanguage sets the language.

func (*TextLine) SetLocation

func (textLine *TextLine) SetLocation(x, y float32) *TextLine

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

func (textLine *TextLine) SetStrikeout(strikeout bool) *TextLine

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

func (textLine *TextLine) SetStructureType(structureType string) *TextLine

SetStructureType sets the type of the structure.

func (*TextLine) SetText

func (textLine *TextLine) SetText(text string) *TextLine

SetText sets the text. @param text the text. @return this TextLine.

func (*TextLine) SetTextDirection

func (textLine *TextLine) SetTextDirection(degrees int) *TextLine

SetTextDirection sets the direction in which to draw the text. @param degrees the number of degrees. @return this TextLine.

func (*TextLine) SetTextEffect

func (textLine *TextLine) SetTextEffect(textEffect int) *TextLine

SetTextEffect sets the text effect. @param textEffect Effect.NORMAL, Effect.SUBSCRIPT or Effect.SUPERSCRIPT. @return this TextLine.

func (*TextLine) SetTrailingSpace

func (textLine *TextLine) SetTrailingSpace(trailingSpace bool) *TextLine

SetTrailingSpace sets the trailing space after this text line when used in paragraph. @param trailingSpace the trailing space. @return this TextLine.

func (*TextLine) SetURIAction

func (textLine *TextLine) SetURIAction(uri *string) *TextLine

SetURIAction sets the URI for the "click text line" action. @param uri the URI @return this TextLine.

func (*TextLine) SetURIActualText

func (textLine *TextLine) SetURIActualText(uriActualText string) *TextLine

SetURIActualText sets the URI actual text.

func (*TextLine) SetURIAltDescription

func (textLine *TextLine) SetURIAltDescription(uriAltDescription string) *TextLine

SetURIAltDescription sets the URI alternative description.

func (*TextLine) SetURILanguage

func (textLine *TextLine) SetURILanguage(uriLanguage string) *TextLine

SetURILanguage sets the URI language.

func (*TextLine) SetUnderline

func (textLine *TextLine) SetUnderline(underline bool) *TextLine

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

func (textLine *TextLine) SetVerticalOffset(verticalOffset float32) *TextLine

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

func NewTitle

func NewTitle(font *Font, text string, x, y float32) *Title

NewTitle is the constructor.

func (*Title) DrawOn

func (title *Title) DrawOn(page *Page)

DrawOn draws the title.

func (*Title) GetPrefix

func (title *Title) GetPrefix() *TextLine

GetPrefix returns the prefix of the title.

func (*Title) SetOffset

func (title *Title) SetOffset(offset float32) *Title

SetOffset sets the offset of the title text.

func (*Title) SetPrefix

func (title *Title) SetPrefix(text string) *Title

SetPrefix sets the prefix text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL