Global

Methods

_getTextBoxOffset()

Source:
To Do:
  • handle page margin and padding

_transformColor(code)

Source:

Transform color code into numeric value or colorModel

Parameters:
Name Type Description
code

color specification in form of HexColor (string, begins with '#'), DecimalColor (1, 3, or 4 element array with values between 0-255), PercentColor (string, begins with '%' followed by values separated by commas with values between 0-100)

appendPDFPageFromPDFWithAnnotations(pdfWriter, sourcePDFPath, pageNumber, optionsopt)

Source:

Append PDF Page with annotations.

Parameters:
Name Type Attributes Default Description
pdfWriter any

Hummus writer.

sourcePDFPath string | any

The path for the output pdfs or Reader stream.

pageNumber number

page number.

options any <optional>
{}

appendPDFPageFromPDF options

appendPDFPagesFromPDFWithAnnotations(pdfWriter, sourcePDFPath, optionsopt)

Source:

Append PDF Pages with annotations.

Parameters:
Name Type Attributes Default Description
pdfWriter any

Hummus writer.

sourcePDFPath string | any

The path for the output pdfs or Reader stream.

options any <optional>
{}

appendPDFPagesFromPDF options

contentToRC(content)

Source:
To Do:
  • Fix display issue for ol/ul in richText

Support CSS2 Style: 'text-align' | 'vertical-align' | 'font-size' | 'font-style' | 'font-weight' | 'font-family' | 'font' | 'color' | 'text-decoration' | 'font-stretch'

Parameters:
Name Type Description
content string

getFlagBitNumberByName(name)

Source:

12.5.3 Annotation Flags

Parameters:
Name Type Description
name string

justify(left, x, wto, textBox, positionopt)

Source:

Justify text in a line.

Parameters:
Name Type Attributes Description
left number

is position of left hand side of text box

x number

is starting position for text placement

wto Array.<Object>

is a write object

textBox Object

holds text box properties

position function <optional>

used to place given word at a postion on the line

percentToHex(code) → {string}

Source:

Convert percentage string into hex string (x / 100 * 255)

Parameters:
Name Type Description
code string

numbers separated by commas with values ranging between 0-100.

Returns:

massaged hexadecimal string that can be used as input to hexToArray.

Type
string

toColorModel(code, colorspace, colorName) → {any}

Source:

Convert given color code int color model object

ColorModel consists of: { color: number, colorspace: string {'rgb', 'cmyk', 'gray'}, (colorspace == 'rgb') r, g, b (colorspace == 'cmyk') c, m, y, k (colorspace == 'gray') gray }

where r,g,b,c,m,y,k,gray are all numbers between 0 and 1

Parameters:
Name Type Description
code string

the color encoding as HexColor

colorspace string

the name of the colorspace of given color code

colorName string

the name to be associated with given color code

Returns:

the color model

Type
any