PdfBuilder¶
Definition¶
Extends¶
Extended By¶
None
Description¶
Builder for generating a Pdf
Method Summary¶
Owner | Name | Return Type | Description |
---|---|---|---|
PdfBuilder | constructor() | PdfBuilder | Create a builder for generating a PDF. |
PdfBuilder | addCellStyle(area, topBorder, rightBorder, bottomBorder, leftBorder, font, backgroundColor) | Object | Cells inside the area will use the supplied formats. Area is required but the style arguments may be null. |
PdfBuilder | addColumn(Number of columns, Gutter Spacing) | Object | Creates a specified number of columns within a page. If gutter spacing is 5, it will be 5% of the page width. Spans columns automatically across the pdf, creating new pages if needed. |
PdfBuilder | addCustomFont(fontPath, fontName) | Object | Adds a new font that can be used within the pdf that is not in the default fonts |
PdfBuilder | addFooter(text, alignment, font) | Object | Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right). |
PdfBuilder | addFooterImage(image, alignment, url) | Object | Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right). |
PdfBuilder | addFooterImage(image, alignment, url, height) | Object | Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right). |
PdfBuilder | addHeader(text, alignment, font) | Object | Adds a header (or remove if text is null). Note, there can be up to two headers at once (center, right). |
PdfBuilder | addHeaderImage(image, alignment, url) | Object | Adds a header (or remove if text is null). Note, there can be up to two headers at once (left, center, right). |
PdfBuilder | addHeaderImage(image, alignment, url, height) | Object | Adds a header (or remove if text is null). Note, there can be up to two headers at once (left,center,right). |
PdfBuilder | appendImage(image, widthInches) | Object | Appends an image to the pdf. If the image width is greater than page width it is automatically scaled to fit. |
PdfBuilder | appendLineBreak() | Object | Starts a new paragraph in the pdf. |
PdfBuilder | appendPageBreak() | Object | Starts a new page in the pdf. |
PdfBuilder | appendTable(table) | Object | Appends a table to the pdf. |
PdfBuilder | appendText(text) | Object | Appends the given text to the pdf. |
PdfBuilder | build() | Binary | Builds and returns a binary containing the pdf. The pdf builder will be reset after this is called |
PdfBuilder | clearCellStyles() | String | Clears the cell styles and resets column widths to a weighting of 1. |
PdfBuilder | createColumn(Text content, Lower Left X Position, Lower Left Y position, Upper Right X Position, Upper Right Y Position, Text style) | Object | Creates a column within the pdf so that you can style your pdfs into 2,3, or more columns. Can also style the text within the columns. |
PdfBuilder | endColumn() | Boolean | Ends the started column page which displays all the column text on the document |
Object | getClassName() | String | Returns the string name of this object's class type. |
PdfBuilder | getColumnhWeight(columnPosition) | Object | Returns the column width (as a weighting). |
PdfBuilder | getFont() | String | get current font for use with text |
PdfBuilder | getHorizontalAlignment() | String | Returns the current alignment. The return will be either LEFT, CENTER, or RIGHT. |
PdfBuilder | getLineSpacing() | Number | get line spacing in inches |
PdfBuilder | getPageBackground() | String | Returns page background color. |
PdfBuilder | getPageHeight() | Number | Returns page height in inches. |
PdfBuilder | getPageMarginAboveFooter() | Number | Returns the page's margin above the footer in inches. |
PdfBuilder | getPageMarginBelowHeader() | Number | get the page margin below header in inches |
PdfBuilder | getPageMarginBottom() | Number | Returns the page's bottom margin in inches. |
PdfBuilder | getPageMarginLeft() | Number | Returns the page's left margin in inches. |
PdfBuilder | getPageMarginRight() | Number | Returns the page's right margin in inches. |
PdfBuilder | getPageMarginTop() | Number | Returns the page's top margin in inches. |
PdfBuilder | getPageWidth() | Number | Returns page width in inches. |
PdfBuilder | getSpacingAfter() | Number | Returns the spacing after paragraphs, tables, images in inches. |
PdfBuilder | getSpacingBefore() | Number | Returns the spacing before paragraphs, tables, images in inches. |
PdfBuilder | getSubscript() | Float | Returns the text lower as a Float. |
PdfBuilder | getSuperscript() | Float | Returns the text rise as a Float. |
PdfBuilder | getTableAlternativeRowBackground() | String | Returns the current background color of the alternative rows of tables as a hexcode. |
PdfBuilder | getTableBackground() | String | Returns the current background color of the tables as a hexcode. |
PdfBuilder | getTableBorderColor() | String | Returns the current border color of the tables. |
PdfBuilder | getTableBorderWidth() | Number | Returns the current border width (in inches) set for tables. |
PdfBuilder | getTableCellFont() | String | Returns the current font for use with table cells. |
PdfBuilder | getTableCellHorizontalAlignment() | String | Returns the horizontal alignment for table cells (either LEFT, CENTER, or RIGHT). |
PdfBuilder | getTableCellPaddingBottom() | Number | Returns the table cell padding bottom in inches. |
PdfBuilder | getTableCellPaddingLeft() | Number | Returns the table cell padding left in inches. |
PdfBuilder | getTableCellPaddingRight() | Number | Returns the table cell padding right in inches. |
PdfBuilder | getTableCellPaddingTop() | Number | Returns table cell padding top in inches. |
PdfBuilder | getTableColumnBorderColor() | String | Returns the current border color of table columns. |
PdfBuilder | getTableColumnBorderWidth() | Number | Returns the current border width (in inches) set for table columns. |
PdfBuilder | getTableHeaderBackground() | String | Returns the current background color applied to table headers as a hexcode. |
PdfBuilder | getTableHeaderFont() | String | Returns the current font for use with table headers. |
PdfBuilder | getTableRowBorderColor() | String | Returns the current border color of tables rows as a hexcode. |
PdfBuilder | getTableRowBorderWidth() | Number | Returns the current border width (in inches) set for table rows. |
PdfBuilder | getTableWidth() | Number | Returns the table width in inches. |
PdfBuilder | reset() | Object | reset the pdf builder |
PdfBuilder | setColumnWeight(columnPosition, weighting) | Object | Sets the column width (as a weighting) for tables, see appendTable(...). |
PdfBuilder | setFont(font) | Object | Sets the current font for use with text. The available fonts are Courier, Helvetica, Times-Roman, Symbol, ZapfDingbats. Styles include: Bold, Italic, Underline, Line-through. |
PdfBuilder | setHorizontalAlignment(alignment) | Object | Sets the current alignment. This will create a line break if a paragraph is in progress. |
PdfBuilder | setImageBackground(color) | Object | Sets the background color for images. |
PdfBuilder | setImageBorder(sizeAndOrColor) | Object | Sets the border to draw around images. |
PdfBuilder | setIndent(Indent) | Object | Sets indent for text |
PdfBuilder | setLineSpacing(lineSpacingInches) | Object | Sets the spacing between each line of text within a paragraph. |
PdfBuilder | setPageBackground(color) | Object | Sets the background color for the page with the given the color hexcode. |
PdfBuilder | setPageMargin(topInches, rightInches, bottomInches, leftInches, belowHeaderInches, aboveFooterInches) | Object | Sets the margins for each page. |
PdfBuilder | setPageSize(widthInches, heightInches) | Object | Sets the size of each page with the width and height. |
PdfBuilder | setSpacing(beforeParagraphInches, afterParagraphInches) | Object | Adds spacing after text, images, or tables. This is a way to vertically align on the pdf. |
PdfBuilder | setSubscript(textLowerPercent) | Object | Sets the percent lower of the text. Setting it as 0.0 is normal baseline. |
PdfBuilder | setSuperscript(textRisePercent) | Object | Sets the percent rise of the text. Setting it as 0.0 is normal baseline. |
PdfBuilder | setTableBackground(color, altColor) | Object | Sets the background color for table rows given the color hexcode. |
PdfBuilder | setTableBorder(sizeAndOrColor) | Object | Sets the border to draw around tables. |
PdfBuilder | setTableCellFont(font) | Object | Sets the current font for use with table cells. See setFont() for options. |
PdfBuilder | setTableCellHorizontalAlignment(alignment) | Object | Sets the alignment of text within table cells. |
PdfBuilder | setTableCellPadding(topInches, rightInches, bottomInches, leftInches) | Object | Sets the padding between text and the border for each cell within a table. |
PdfBuilder | setTableColumnBorder(sizeAndOrColor) | Object | Sets the border to draw between columns. |
PdfBuilder | setTableHeaderBackground(color) | Object | Sets the current background color with the given color hexcode for table header. |
PdfBuilder | setTableHeaderFont(font) | Object | Sets the current font for use with table header. See setFont() for options. |
PdfBuilder | setTableRowBorder(sizeAndOrColor) | Object | Sets the border to draw between rows. |
PdfBuilder | setTableWidth(widthInches) | Object | Sets the table width given the width. |
PdfBuilder | spanImage(image, widthInches, offset) | Object | Spans an image to the pdf. The image offset determines the spacing between images that are spanned |
Object | toJson() | String | Returns a json representation of this object. |
Method Definitions¶
constructor()¶
PdfBuilder pdfbuilder = new PdfBuilder()
Description¶
Create a builder for generating a PDF.
addCellStyle(area,topBorder,rightBorder,bottomBorder,leftBorder,font,backgroundColor)¶
Object PdfBuilder::addCellStyle(Rectangle area, String topBorder, String rightBorder, String bottomBorder, String leftBorder, String font, String backgroundColor)
Description¶
Cells inside the area will use the supplied formats. Area is required but the style arguments may be null.
Parameter Definition¶
Name | Type | Description |
---|---|---|
area | Rectangle | location of cells to apply formatting to |
topBorder | String | Optional, combination of size(in inches) and color, ex: .0005 #FF0000 |
rightBorder | String | Optional, combination of size(in inches) and color, ex: .0005 #FF0000 |
bottomBorder | String | Optional, combination of size(in inches) and color, ex: .0005 #FF0000 |
leftBorder | String | Optional, combination of size(in inches) and color, ex: .0005 #FF0000 |
font | String | Optional, any combination of size (in inches),family,color,style, alignment (LEFT,CENTER,RIGHT, TOP, MIDDLE, BOTTOM) , ex: 15 Helvetica bold intalic #FF0000 left |
backgroundColor | String | Optional, color |
addColumn(Number of columns,Gutter Spacing)¶
Object PdfBuilder::addColumn(Integer Number of columns, Double Gutter Spacing)
Description¶
Creates a specified number of columns within a page. If gutter spacing is 5, it will be 5% of the page width. Spans columns automatically across the pdf, creating new pages if needed.
Parameter Definition¶
Name | Type | Description |
---|---|---|
Number of columns | Integer | Number of columns you want to split the page |
Gutter Spacing | Double | Width of gutter spacing between columns as percentage of page width |
addCustomFont(fontPath,fontName)¶
Object PdfBuilder::addCustomFont(String fontPath, String fontName)
Description¶
Adds a new font that can be used within the pdf that is not in the default fonts
Parameter Definition¶
Name | Type | Description |
---|---|---|
fontPath | String | path of ttf file of font to add |
fontName | String | font name |
addFooter(text,alignment,font)¶
Object PdfBuilder::addFooter(String text, String alignment, String font)
Description¶
Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
text | String | text or null to remove, ${page} will be substituted for current page number |
alignment | String | either LEFT, CENTER or RIGHT |
font | String | see setFont for examples |
addFooterImage(image,alignment,url)¶
Object PdfBuilder::addFooterImage(Binary image, String alignment, String url)
Description¶
Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | image or null to remove, ${page} will be substituted for current page number |
alignment | String | either LEFT, CENTER or RIGHT |
url | String | url to open when clicked |
addFooterImage(image,alignment,url,height)¶
Object PdfBuilder::addFooterImage(Binary image, String alignment, String url, Number height)
Description¶
Adds a footer (or remove if text is null). Note, there can be up to three footers at once (left, center, right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | image or null to remove, ${page} will be substituted for current page number |
alignment | String | either LEFT, CENTER or RIGHT |
url | String | url to open when clicked |
height | Number | Height in inches, default is .25 |
addHeader(text,alignment,font)¶
Object PdfBuilder::addHeader(String text, String alignment, String font)
Description¶
Adds a header (or remove if text is null). Note, there can be up to two headers at once (center, right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
text | String | text or null to remove, ${page} will be substituted for current page number |
alignment | String | either CENTER or RIGHT |
font | String | see setFont for examples |
addHeaderImage(image,alignment,url)¶
Object PdfBuilder::addHeaderImage(Binary image, String alignment, String url)
Description¶
Adds a header (or remove if text is null). Note, there can be up to two headers at once (left, center, right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | image or null to remove, ${page} will be substituted for current page number |
alignment | String | LEFT, CENTER or RIGHT |
url | String | url to open when clicked |
addHeaderImage(image,alignment,url,height)¶
Object PdfBuilder::addHeaderImage(Binary image, String alignment, String url, Number height)
Description¶
Adds a header (or remove if text is null). Note, there can be up to two headers at once (left,center,right).
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | image or null to remove, ${page} will be substituted for current page number |
alignment | String | LEFT, CENTER or RIGHT |
url | String | url to open when clicked |
height | Number | Height in inches, default is .25 |
appendImage(image,widthInches)¶
Object PdfBuilder::appendImage(Binary image, Number widthInches)
Description¶
Appends an image to the pdf. If the image width is greater than page width it is automatically scaled to fit.
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | the image to add |
widthInches | Number | width in inches, or null to use default image width |
appendLineBreak()¶
Object PdfBuilder::appendLineBreak()
Description¶
Starts a new paragraph in the pdf.
appendPageBreak()¶
Object PdfBuilder::appendPageBreak()
Description¶
Starts a new page in the pdf.
appendTable(table)¶
Object PdfBuilder::appendTable(Table table)
Description¶
Appends a table to the pdf.
Parameter Definition¶
Name | Type | Description |
---|---|---|
table | Table |
appendText(text)¶
Object PdfBuilder::appendText(String text)
Description¶
Appends the given text to the pdf.
Parameter Definition¶
Name | Type | Description |
---|---|---|
text | String |
build()¶
Binary PdfBuilder::build()
Description¶
Builds and returns a binary containing the pdf. The pdf builder will be reset after this is called
clearCellStyles()¶
String PdfBuilder::clearCellStyles()
Description¶
Clears the cell styles and resets column widths to a weighting of 1.
createColumn(Text content,Lower Left X Position,Lower Left Y position,Upper Right X Position,Upper Right Y Position,Text style)¶
Object PdfBuilder::createColumn(String Text content, Number Lower Left X Position, Number Lower Left Y position, Number Upper Right X Position, Number Upper Right Y Position, String Text style)
Description¶
Creates a column within the pdf so that you can style your pdfs into 2,3, or more columns. Can also style the text within the columns.
Parameter Definition¶
Name | Type | Description |
---|---|---|
Text content | String | The text content you want to display in the column |
Lower Left X Position | Number | The x coordinate of the lower left position of the rectangle. Two points (lower left, upper right) of rectangle |
Lower Left Y position | Number | The y coordinate of the lower left position of the rectangle |
Upper Right X Position | Number | The upper right x position of the rectangle |
Upper Right Y Position | Number | The upper right y position of the rectangle |
Text style | String | The style of the text ex) ("0.12 normal #BBF000") |
endColumn()¶
Boolean PdfBuilder::endColumn()
Description¶
Ends the started column page which displays all the column text on the document
getColumnhWeight(columnPosition)¶
Object PdfBuilder::getColumnhWeight(Integer columnPosition)
Description¶
Returns the column width (as a weighting).
Parameter Definition¶
Name | Type | Description |
---|---|---|
columnPosition | Integer | 0 is the left most column, 1 is the next column, etc |
getFont()¶
String PdfBuilder::getFont()
Description¶
get current font for use with text
getHorizontalAlignment()¶
String PdfBuilder::getHorizontalAlignment()
Description¶
Returns the current alignment. The return will be either LEFT, CENTER, or RIGHT.
getLineSpacing()¶
Number PdfBuilder::getLineSpacing()
Description¶
get line spacing in inches
getPageBackground()¶
String PdfBuilder::getPageBackground()
Description¶
Returns page background color.
getPageHeight()¶
Number PdfBuilder::getPageHeight()
Description¶
Returns page height in inches.
getPageMarginAboveFooter()¶
Number PdfBuilder::getPageMarginAboveFooter()
Description¶
Returns the page's margin above the footer in inches.
getPageMarginBelowHeader()¶
Number PdfBuilder::getPageMarginBelowHeader()
Description¶
get the page margin below header in inches
getPageMarginBottom()¶
Number PdfBuilder::getPageMarginBottom()
Description¶
Returns the page's bottom margin in inches.
getPageMarginLeft()¶
Number PdfBuilder::getPageMarginLeft()
Description¶
Returns the page's left margin in inches.
getPageMarginRight()¶
Number PdfBuilder::getPageMarginRight()
Description¶
Returns the page's right margin in inches.
getPageMarginTop()¶
Number PdfBuilder::getPageMarginTop()
Description¶
Returns the page's top margin in inches.
getPageWidth()¶
Number PdfBuilder::getPageWidth()
Description¶
Returns page width in inches.
getSpacingAfter()¶
Number PdfBuilder::getSpacingAfter()
Description¶
Returns the spacing after paragraphs, tables, images in inches.
getSpacingBefore()¶
Number PdfBuilder::getSpacingBefore()
Description¶
Returns the spacing before paragraphs, tables, images in inches.
getSubscript()¶
Float PdfBuilder::getSubscript()
Description¶
Returns the text lower as a Float.
getSuperscript()¶
Float PdfBuilder::getSuperscript()
Description¶
Returns the text rise as a Float.
getTableAlternativeRowBackground()¶
String PdfBuilder::getTableAlternativeRowBackground()
Description¶
Returns the current background color of the alternative rows of tables as a hexcode.
getTableBackground()¶
String PdfBuilder::getTableBackground()
Description¶
Returns the current background color of the tables as a hexcode.
getTableBorderColor()¶
String PdfBuilder::getTableBorderColor()
Description¶
Returns the current border color of the tables.
getTableBorderWidth()¶
Number PdfBuilder::getTableBorderWidth()
Description¶
Returns the current border width (in inches) set for tables.
getTableCellFont()¶
String PdfBuilder::getTableCellFont()
Description¶
Returns the current font for use with table cells.
getTableCellHorizontalAlignment()¶
String PdfBuilder::getTableCellHorizontalAlignment()
Description¶
Returns the horizontal alignment for table cells (either LEFT, CENTER, or RIGHT).
getTableCellPaddingBottom()¶
Number PdfBuilder::getTableCellPaddingBottom()
Description¶
Returns the table cell padding bottom in inches.
getTableCellPaddingLeft()¶
Number PdfBuilder::getTableCellPaddingLeft()
Description¶
Returns the table cell padding left in inches.
getTableCellPaddingRight()¶
Number PdfBuilder::getTableCellPaddingRight()
Description¶
Returns the table cell padding right in inches.
getTableCellPaddingTop()¶
Number PdfBuilder::getTableCellPaddingTop()
Description¶
Returns table cell padding top in inches.
getTableColumnBorderColor()¶
String PdfBuilder::getTableColumnBorderColor()
Description¶
Returns the current border color of table columns.
getTableColumnBorderWidth()¶
Number PdfBuilder::getTableColumnBorderWidth()
Description¶
Returns the current border width (in inches) set for table columns.
getTableHeaderBackground()¶
String PdfBuilder::getTableHeaderBackground()
Description¶
Returns the current background color applied to table headers as a hexcode.
getTableHeaderFont()¶
String PdfBuilder::getTableHeaderFont()
Description¶
Returns the current font for use with table headers.
getTableRowBorderColor()¶
String PdfBuilder::getTableRowBorderColor()
Description¶
Returns the current border color of tables rows as a hexcode.
getTableRowBorderWidth()¶
Number PdfBuilder::getTableRowBorderWidth()
Description¶
Returns the current border width (in inches) set for table rows.
getTableWidth()¶
Number PdfBuilder::getTableWidth()
Description¶
Returns the table width in inches.
reset()¶
Object PdfBuilder::reset()
Description¶
reset the pdf builder
setColumnWeight(columnPosition,weighting)¶
Object PdfBuilder::setColumnWeight(Integer columnPosition, Number weighting)
Description¶
Sets the column width (as a weighting) for tables, see appendTable(...).
Parameter Definition¶
Name | Type | Description |
---|---|---|
columnPosition | Integer | 0 is the left most column, 1 is the next column, etc |
weighting | Number | 1 is the default weighting for all columns, 2 would be twice the width, .5 would be 1/2 the width. Must be a positive number |
setFont(font)¶
Object PdfBuilder::setFont(String font)
Description¶
Sets the current font for use with text. The available fonts are Courier, Helvetica, Times-Roman, Symbol, ZapfDingbats. Styles include: Bold, Italic, Underline, Line-through.
Parameter Definition¶
Name | Type | Description |
---|---|---|
font | String | any combination of size (in inches),family,color,style, ex: 15 Helvetica bold intalic #FF0000 |
setHorizontalAlignment(alignment)¶
Object PdfBuilder::setHorizontalAlignment(String alignment)
Description¶
Sets the current alignment. This will create a line break if a paragraph is in progress.
Parameter Definition¶
Name | Type | Description |
---|---|---|
alignment | String | either: LEFT, CENTER, RIGHT |
setImageBackground(color)¶
Object PdfBuilder::setImageBackground(String color)
Description¶
Sets the background color for images.
Parameter Definition¶
Name | Type | Description |
---|---|---|
color | String | color or null for transparent |
setImageBorder(sizeAndOrColor)¶
Object PdfBuilder::setImageBorder(String sizeAndOrColor)
Description¶
Sets the border to draw around images.
Parameter Definition¶
Name | Type | Description |
---|---|---|
sizeAndOrColor | String | any combination of size(in inches) and color, ex: .0005 #FF0000 |
setIndent(Indent)¶
Object PdfBuilder::setIndent(Number Indent)
Description¶
Sets indent for text
Parameter Definition¶
Name | Type | Description |
---|---|---|
Indent | Number | Indent in inches |
setLineSpacing(lineSpacingInches)¶
Object PdfBuilder::setLineSpacing(Number lineSpacingInches)
Description¶
Sets the spacing between each line of text within a paragraph.
Parameter Definition¶
Name | Type | Description |
---|---|---|
lineSpacingInches | Number | Spacing in inches between lines (plus height of font) |
setPageBackground(color)¶
Object PdfBuilder::setPageBackground(String color)
Description¶
Sets the background color for the page with the given the color hexcode.
Parameter Definition¶
Name | Type | Description |
---|---|---|
color | String | color for page |
setPageMargin(topInches,rightInches,bottomInches,leftInches,belowHeaderInches,aboveFooterInches)¶
Object PdfBuilder::setPageMargin(Number topInches, Number rightInches, Number bottomInches, Number leftInches, Number belowHeaderInches, Number aboveFooterInches)
Description¶
Sets the margins for each page.
Parameter Definition¶
Name | Type | Description |
---|---|---|
topInches | Number | top or null to keep existing |
rightInches | Number | right or null to keep existing |
bottomInches | Number | bottom or null to keep existing |
leftInches | Number | left or null to keep existing |
belowHeaderInches | Number | distance between bottom of header and top of body |
aboveFooterInches | Number | distance between top of footer and bottom of body |
setPageSize(widthInches,heightInches)¶
Object PdfBuilder::setPageSize(Number widthInches, Number heightInches)
Description¶
Sets the size of each page with the width and height.
Parameter Definition¶
Name | Type | Description |
---|---|---|
widthInches | Number | width or null to keep existing width |
heightInches | Number | height or null to keep existing width |
setSpacing(beforeParagraphInches,afterParagraphInches)¶
Object PdfBuilder::setSpacing(Number beforeParagraphInches, Number afterParagraphInches)
Description¶
Adds spacing after text, images, or tables. This is a way to vertically align on the pdf.
Parameter Definition¶
Name | Type | Description |
---|---|---|
beforeParagraphInches | Number | Spacing, in inches, , images and tables |
afterParagraphInches | Number | Spacing, in inches, after paragraphs, images and tables |
setSubscript(textLowerPercent)¶
Object PdfBuilder::setSubscript(Number textLowerPercent)
Description¶
Sets the percent lower of the text. Setting it as 0.0 is normal baseline.
Parameter Definition¶
Name | Type | Description |
---|---|---|
textLowerPercent | Number | The percent to lower (valid range is 0.0 - 1.0), .3 is a good suggestion |
setSuperscript(textRisePercent)¶
Object PdfBuilder::setSuperscript(Number textRisePercent)
Description¶
Sets the percent rise of the text. Setting it as 0.0 is normal baseline.
Parameter Definition¶
Name | Type | Description |
---|---|---|
textRisePercent | Number | The percent to raise (valid range is 0.0 - 1.0), .3 is a good suggestion |
setTableBackground(color,altColor)¶
Object PdfBuilder::setTableBackground(String color, String altColor)
Description¶
Sets the background color for table rows given the color hexcode.
Parameter Definition¶
Name | Type | Description |
---|---|---|
color | String | color for even numbered rows |
altColor | String | color for odd numbered rows |
setTableBorder(sizeAndOrColor)¶
Object PdfBuilder::setTableBorder(String sizeAndOrColor)
Description¶
Sets the border to draw around tables.
Parameter Definition¶
Name | Type | Description |
---|---|---|
sizeAndOrColor | String | any combination of size(in inches) and color, ex: .0005 #FF0000 |
setTableCellFont(font)¶
Object PdfBuilder::setTableCellFont(String font)
Description¶
Sets the current font for use with table cells. See setFont() for options.
Parameter Definition¶
Name | Type | Description |
---|---|---|
font | String | any combination of size (in inches),family,color,style, ex: 15 Helvetica bold intalic #FF0000 |
setTableCellHorizontalAlignment(alignment)¶
Object PdfBuilder::setTableCellHorizontalAlignment(String alignment)
Description¶
Sets the alignment of text within table cells.
Parameter Definition¶
Name | Type | Description |
---|---|---|
alignment | String | Either: LEFT, CENTER, RIGHT |
setTableCellPadding(topInches,rightInches,bottomInches,leftInches)¶
Object PdfBuilder::setTableCellPadding(Number topInches, Number rightInches, Number bottomInches, Number leftInches)
Description¶
Sets the padding between text and the border for each cell within a table.
Parameter Definition¶
Name | Type | Description |
---|---|---|
topInches | Number | top or null to keep existing |
rightInches | Number | right or null to keep existing |
bottomInches | Number | bottom or null to keep existing |
leftInches | Number | left or null to keep existing |
setTableColumnBorder(sizeAndOrColor)¶
Object PdfBuilder::setTableColumnBorder(String sizeAndOrColor)
Description¶
Sets the border to draw between columns.
Parameter Definition¶
Name | Type | Description |
---|---|---|
sizeAndOrColor | String | any combination of size(in inches) and color, ex: .0005 #FF0000 |
setTableHeaderBackground(color)¶
Object PdfBuilder::setTableHeaderBackground(String color)
Description¶
Sets the current background color with the given color hexcode for table header.
Parameter Definition¶
Name | Type | Description |
---|---|---|
color | String | ex: #FF0000 |
setTableHeaderFont(font)¶
Object PdfBuilder::setTableHeaderFont(String font)
Description¶
Sets the current font for use with table header. See setFont() for options.
Parameter Definition¶
Name | Type | Description |
---|---|---|
font | String | any combination of size (in inches),family,color,style, ex: 15 Helvetica bold intalic #FF0000 |
setTableRowBorder(sizeAndOrColor)¶
Object PdfBuilder::setTableRowBorder(String sizeAndOrColor)
Description¶
Sets the border to draw between rows.
Parameter Definition¶
Name | Type | Description |
---|---|---|
sizeAndOrColor | String | any combination of size(in inches) and color, ex: .0005 #FF0000 |
setTableWidth(widthInches)¶
Object PdfBuilder::setTableWidth(Number widthInches)
Description¶
Sets the table width given the width.
Parameter Definition¶
Name | Type | Description |
---|---|---|
widthInches | Number | width of table in inches or null to auto-size |
spanImage(image,widthInches,offset)¶
Object PdfBuilder::spanImage(Binary image, Number widthInches, Number offset)
Description¶
Spans an image to the pdf. The image offset determines the spacing between images that are spanned
Parameter Definition¶
Name | Type | Description |
---|---|---|
image | Binary | the image to add |
widthInches | Number | width in inches, or null to use default image width |
offset | Number | the image offset in the x direction |