Prince supports most of ECMAScript 5th edition (ES5), with the exception of strict mode. ES6 is not fully supported yet, and later editions of ECMAScript are not supported.
The following table shows supported JavaScript objects, methods and properties. For more details, see also JavaScript in Prince .
* objects, methods and properties marked with an asterisk and a darker background color shade are Prince extensions.
Objects, methods and properties with a line-through are deprecated, support might
be removed in a future Prince version.
Toggle (open/close) all properties
window
NaN
number The special value Not a Number.
Infinity
number The special value Infinity.
undefined
Represents the special value undefined.
evalsource
function Evaluates text as JavaScript source code.
source
string
Code to evaluate
Result of evaluation
parseIntvalue, radix
function Turns input into an integer number.
number
parseFloat
function Turns input into a floating point number.
number
isNaN
function Checks if the argument's value is the special Not a Number value.
boolean
isNaN(parseInt('hello'))true
isFinite
function Determines whether the passed value is a finite number.
boolean
escapestring
function Computes a new string by replacing certain characters with a hexadecimal escape sequence.
string
string
String to escape
string
unescapestring
function Computes a new string by replacing hexadecimal escape sequences with the characters they represent.
string
string
String to unescape
string
decodeURIURI
function Decodes a Uniform Resource Identifier (URI).
string
decodeURIComponentURI
function Decodes a Uniform Resource Identifier (URI) component.
URI
string
A component of a URI
string
encodeURIURI
function Encodes a Uniform Resource Identifier (URI).
string
encodeURIComponentURI
function Encodes a Uniform Resource Identifier (URI) component.
URI
string
A component of a URI
string
toString
toLocaleString
function Converts an object to a string with a language sensitive representation of said string.
string
valueOf
function Returns the primitive value an object.
primitive value
hasOwnPropertyproperty
function Returns a boolean indicating whether the object has the specified property.
property
string
The property to test
boolean
isPrototypeOf
function Checks if an object exists in another object's prototype chain.
boolean
propertyIsEnumerable
function Returns a Boolean indicating whether the specified property is enumerable.
boolean
Object
function
assign
function
create
function
definePropertybase object, property name, descriptor
function Adds a property to the object and defines certain traits like enumerability.
Object.defineProperty(Array.prototype, 'myProp',
{enumerable: false}) defineProperties
function
freeze
function
is
function
isExtensible
function
isFrozen
function
isSealed
function
keys
function
getOwnPropertyDescriptor
function
getOwnPropertyNames
function
getOwnPropertySymbols
function
getPrototypeOf
function
preventExtensions
function
seal
function
setPrototypeOf
function
prototype
object
toString
function
toLocaleString
function
valueOf
function
hasOwnProperty
function
isPrototypeOf
function
propertyIsEnumerable
function
Function
function
prototype
function
toString
function
apply
function
bindnew this object
function Defines a value for the this object, returns a new function.
function
var myObj = {};
function myFunc(){return this===myObj;};
var boundFunc = myFunc.bind(myObj);
boundFunc();true
call
function
Array
function
isArray
function
from
function
of
function
prototype
object
length
number
toString
function
toLocaleString
function
join
function
concat
function
pop
function
push
function
reverse
function
shift
function
unshift
function
find
function
findIndex
function
sort
function
slice
function
splice
function
indexOf
function
lastIndexOf
function
forEach
function
map
function
filter
function
includes
function
every
function
some
function
reduce
function
fill
function
reduceRight
function
Map
function
prototype
object
size
clear
function
deletekey
getkey
haskey
setkey, value
keys
function
values
function
entries
function
forEachcallbackFn, thisArg
function
callbackFn
function
thisArg
argument
String
function
fromCharCode
function
fromCodePoint
function
CodePointAt
raw
function
prototype
object
length
number
toString
function
valueOf
function
charAt
function
charCodeAt
function
concat
function
includes
function
indexOf
function
lastIndexOf
function
localeCompare
function
split
function
toLowerCase
function
toLocaleLowerCase
function
toUpperCase
function
toLocaleUpperCase
function
match
function
repeat
function
replace
function
search
function
slice
function
startsWith
function
endsWith
function
substring
function
substr
function
trim
function
Boolean
function
prototype
object
toString
function
valueOf
function
Number
function
NaN
number
POSITIVE_INFINITY
number
NEGATIVE_INFINITY
number
MIN_VALUE
number
MAX_VALUE
number
MIN_SAFE_INTEGER
number
MAX_SAFE_INTEGER
number
prototype
object
toExponential
function
toString
function
valueOf
function
toFixed
function
toPrecision
function
Date
function
parse
function
UTC
function
now
function
prototype
object
toString
function
toDateString
function
toTimeString
function
toUTCString
function
toISOString
function
valueOf
function
getTime
function
getFullYear
function
getMonth
function
getDate
function
getDay
function
getHours
function
getMinutes
function
getSeconds
function
getMilliseconds
function
getUTCFullYear
function
getUTCMonth
function
getUTCDate
function
getUTCDay
function
getUTCHours
function
getUTCMinutes
function
getUTCSeconds
function
getUTCMilliseconds
function
setTime
function
setMilliseconds
function
setSeconds
function
setMinutes
function
setHours
function
setDate
function
setMonth
function
setFullYear
function
setUTCMilliseconds
function
setUTCSeconds
function
setUTCMinutes
function
setUTCHours
function
setUTCDate
function
setUTCMonth
function
setUTCFullYear
function
RegExp
function
prototype
object
exec
function
test
function
toString
function
Math
object
E
number
LN10
number
LN2
number
LOG2E
number
LOG10E
number
PI
number
SQRT1_2
number
SQRT2
number
abs
function
acos
function
asin
function
atan
function
atan2
function
ceil
function
cos
function
exp
function
floor
function
log
function
max
function
min
function
pow
function
random
function
seedRandom
round
function
sin
function
sqrt
function
tan
function
JSON
object
parse
function
stringify
function
Error
function
prototype
object
name
string
message
string
stack
RangeError
function
ReferenceError
function
SyntaxError
function
TypeError
function
URIError
function
window
object
self
object
top
object
parent
object
setTimeout
function
clearTimeout
function
alert
function
addEventListener
function
removeEventListener
function
dispatchEvent
function
getComputedStyle
function
navigator
object
appName
string
appVersion
string
platform
string
userAgent
string
onLine
boolean
console
object
log
function
info
function
warn
function
frames
object
ArrayBuffer
function
Uint8Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Uint8ClampedArray
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Uint16Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Uint32Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Int8Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Int16Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
Int32Array
function
BYTES_PER_ELEMENT
number
from
function
prototype
object
BYTES_PER_ELEMENT
number
length
number
set
function
subarray
function
XMLHttpRequest
function
UNSENT
number
OPENED
number
number
LOADING
number
DONE
number
prototype
object
UNSENT
number
OPENED
number
number
LOADING
number
DONE
number
open
function
send
function
readyState
function
response
function
responseText
function
responseType
function
status
function
EventTarget
function
prototype
object
addEventListener
function
removeEventListener
function
dispatchEvent
function
Event
function
ProgressEvent
function
Node
function
ELEMENT_NODE
number
ATTRIBUTE_NODE
number
TEXT_NODE
number
DOCUMENT_NODE
number
DOCUMENT_FRAGMENT_NODE
number
DOCUMENT_POSITION_DISCONNECTED
number
DOCUMENT_POSITION_PRECEDING
number
DOCUMENT_POSITION_FOLLOWING
number
DOCUMENT_POSITION_CONTAINS
number
DOCUMENT_POSITION_CONTAINED_BY
number
prototype
object
ELEMENT_NODE
number
ATTRIBUTE_NODE
number
TEXT_NODE
number
DOCUMENT_NODE
number
DOCUMENT_FRAGMENT_NODE
number
DOCUMENT_POSITION_DISCONNECTED
number
DOCUMENT_POSITION_PRECEDING
number
DOCUMENT_POSITION_FOLLOWING
number
DOCUMENT_POSITION_CONTAINS
number
DOCUMENT_POSITION_CONTAINED_BY
number
ownerDocument
number
textContent
number
firstChild
number
lastChild
number
previousSibling
number
nextSibling
number
parentElement
number
parentNode
number
removeChild
function
appendChild
function
insertBefore
function
replaceChild
function
hasChildNodes
function
hasAttributes
contains
function
compareDocumentPosition
function
cloneNode
function
Document
function
prototype
object
implementation
documentElement
firstElementChild
lastElementChild
childElementCount
readyState
getElementsByTagName
function
getElementsByTagNameNS
function
getElementsByClassName
function
querySelector
function
querySelectorAll
function
getElementById
function
createElement
function
createElementNS
function
createAttribute
function
createAttributeNS
function
createTextNode
function
function
createDocumentFragment
function
nodeName
function
nodeType
function
attributes
namespaceURI
localName
compatMode
DocumentFragment
function
prototype
object
nodeName
nodeType
attributes
namespaceURI
localName
firstElementChild
lastElementChild
childElementCount
Element
function
prototype
object
nodeType
tagName
nodeName
localName
namespaceURI
id
className
classList
innerHTML
firstElementChild
lastElementChild
childElementCount
previousElementSibling
nextElementSibling
getElementsByTagName
function
getElementsByTagNameNS
function
getElementsByClassName
function
before
function
after
function
append
function
remove
function
replaceWith
function
matches
function
querySelector
function
querySelectorAll
function
getAttribute
function
getAttributeNS
function
getAttributeNode
function
getAttributeNodeNS
function
removeAttribute
function
removeAttributeNS
function
removeAttributeNode
function
setAttributeNode
function
setAttributeNodeNS
function
setAttribute
function
setAttributeNS
function
hasAttribute
function
hasAttributeNS
function
getPrinceBoxes
A list of JavaScript objects called
boxes .
Attribute
prototype
nodeType
name
nodeName
localName
namespaceURI
value
nodeValue
ownerElement
attributes
childNodes
Text
function
prototype
object
nodeName
nodeType
attributes
childNodes
previousElementSibling
nextElementSibling
splitText
function
data
function
nodeValue
function
length
function
HTMLDocument
function
prototype
object
head
body
title
innerHTML
write
function
HTMLCollection
function
prototype
object
item
function
namedItem
function
length
function
NodeList
function
prototype
object
item
function
length
function
NamedNodeMap
function
prototype
object
length
item
function
getNamedItem
function
getNamedItemNS
function
setNamedItem
function
setNamedItemNS
function
removeNamedItem
function
removeNamedItemNS
function
CSSStyleDeclaration
function
prototype
object
alignContent
alignItems
alignSelf
background
backgroundAttachment
backgroundClip
backgroundColor
backgroundImage
backgroundImageResolution
backgroundOrigin
backgroundPosition
backgroundRepeat
backgroundSize
baselineShift
bookmarkLabel
bookmarkLevel
bookmarkState
bookmarkTarget
border
borderBottom
borderBottomColor
borderBottomLeftRadius
borderBottomRightRadius
borderBottomStyle
borderBottomWidth
borderClip
borderCollapse
borderColor
borderLeft
borderLeftColor
borderLeftStyle
borderLeftWidth
borderRadius
borderRight
borderRightColor
borderRightStyle
borderRightWidth
borderSpacing
borderStyle
borderTop
borderTopColor
borderTopLeftRadius
borderTopRightRadius
borderTopStyle
borderTopWidth
borderWidth
bottom
boxDecorationBreak
boxSizing
breakAfter
breakBefore
breakInside
captionPage
captionSide
clear
clip
clipPath
clipRule
color
colorInterpolation
colorInterpolationFilters
columnBreakAfter
columnBreakBefore
columnCount
columnFill
columnGap
columnRule
columnRuleColor
columnRuleStyle
columnRuleWidth
columns
columnSpan
columnWidth
content
counterIncrement
counterReset
direction
display
dominantBaseline
emptyCells
fill
fillOpacity
fillRule
filter
flex
flexBasis
flexDirection
flexFlow
flexGrow
flexShrink
flexWrap
floodColor
floodOpacity
cssFloat
floatDeferColumn
floatDeferPage
floatModifier
floatPlacement
floatReference
floatTail
floatPolicy
flow
font
fontFamily
fontSize
fontStretch
fontStyle
fontVariant
fontWeight
gap
height
hyphenateAfter
hyphenateBefore
hyphenateLines
hyphenatePatterns
hyphens
imageOrientation
imageResolution
insetInside
insetOutside
justifyContent
left
letterSpacing
lightingColor
lineHeight
lineStackingStrategy
link
listStyle
listStyleImage
listStylePosition
listStyleType
margin
marginAlt
marginBottom
marginInside
marginLeft
marginOutside
marginRight
marginTop
marker
markerEnd
markerMid
markerStart
mask
maxHeight
maxWidth
minHeight
minWidth
opacity
order
orphans
overflow
overflowWrap
padding
paddingBottom
paddingLeft
paddingRight
paddingTop
page
pageBreakAfter
pageBreakBefore
pageBreakInside
pageGroup
position
princeBackgroundImageResolution
princeBookmarkLabel
princeBookmarkLevel
princeBookmarkState
princeBookmarkTarget
princeCaptionPage
princeClear
princeFilterResolution
princeFloatDeferColumn
princeFloatDeferPage
princeFloatModifier
princeFloatPlacement
princeFloatReference
princeFloatTail
princeFloatPolicy
princeFlow
princeHyphenateAfter
princeHyphenateBefore
princeHyphenateCharacter
princeHyphenateLines
princeHyphenatePatterns
princeImageMagic
princeImageResolution
princeLang
princeLinebreakMagic
princeLink
princeMarginAlt
princePageGroup
princePdfAnnotationAuthor
princePdfAnnotationColor
princePdfAnnotationContents
princePdfAnnotationCreatedate
princePdfAnnotationModifydate
princePdfAnnotationPosition
princePdfAnnotationTitle
princePdfAnnotationType
princePdfColorConversion
princePdfColorOptions
princePdfDestination
princePdfLinkType
princePdfTagType
princeTableColumnSpan
princeTableRowSpan
princeTextJustify
princeTextReplace
princeTooltip
right
rowGap
stopColor
stopOpacity
stringSet
stroke
strokeDasharray
strokeDashoffset
strokeLinecap
strokeLinejoin
strokeMiterlimit
strokeOpacity
strokeWidth
tableBaseline
tableColumnSpan
tableLayout
tableRowSpan
tabSize
textAlign
textAlignAll
textAlignLast
textAnchor
textDecoration
textIndent
textJustify
textLineThrough
textLineThroughColor
textLineThroughStyle
textOverflow
textOverline
textOverlineColor
textOverlineStyle
textTransform
textUnderline
textUnderlineColor
textUnderlinePosition
textUnderlineStyle
top
transform
transformOrigin
unicodeBidi
verticalAlign
visibility
whiteSpace
widows
width
wordBreak
wordSpacing
writingMode
zIndex
setProperty
function
removeProperty
function
setPropertyValue
getPropertyValue
function
DOMException
function
prototype
object
INDEX_SIZE_ERR
number
HIERARCHY_REQUEST_ERR
number
NO_MODIFICATION_ALLOWED_ERR
number
NOT_FOUND_ERR
number
NOT_SUPPORTED_ERR
number
INUSE_ATTRIBUTE_ERR
number
INVALID_STATE_ERR
number
SYNTAX_ERR
number
TYPE_MISMATCH_ERR
number
SVGException
prototype
SVG_INVALID_VALUE_ERR
SVG_MATRIX_NOT_INVERTABLE
DOMImplementation
function
prototype
object
createDocument
function
createHTMLDocument
function
hasFeature
function
DOMParser
function
DOMTokenList
function
prototype
object
length
value
item
function
contains
function
add
function
remove
function
replace
function
supports
function
toggle
function
entries
function
forEach
function
keys
function
values
function
SVGMatrix
function
prototype
object
multiply
function
inverse
function
translate
function
scale
function
scaleNonUniform
function
rotate
function
rotateFromVector
function
flipX
function
flipY
function
skewX
function
skewY
function
a
function
b
function
c
function
d
function
e
function
f
function
CanvasRenderingContext2D
function
prototype
object
save
function
restore
function
scale
function
rotate
function
translate
function
transform
function
setTransform
function
resetTransform
function
moveTo
function
lineTo
function
rect
function
clearRect
function
fillRect
function
strokeRect
function
arc
function
arcTo
function
ellipse
function
bezierCurveTo
function
quadraticCurveTo
function
beginPath
function
closePath
function
fill
function
stroke
function
setLineDash
function
getLineDash
function
systemFocusRing
customFocusRing
scrollPathIntoView
clip
function
resetClip
isPointInPath
function
fillText
function
strokeText
function
measureText
function
createLinearGradient
function
createRadialGradient
function
createPattern
function
drawImage
function
createImageData
function
getImageData
function
putImageData
function
globalAlpha
function
globalCompositeOperation
function
strokeStyle
function
fillStyle
function
lineWidth
function
lineCap
function
lineJoin
function
lineDashOffset
function
miterLimit
function
font
function
textAlign
function
textBaseline
function
shadowColor
function
shadowOffsetX
function
shadowOffsetY
function
shadowBlue
ImageData
function
Image
function
HTMLElement
function
HTMLAnchorElement
function
prototype
object
href
protocol
username
password
host
hostname
port
pathname
search
hash
name
target
HTMLAreaElement
function
prototype
object
href
protocol
username
password
host
hostname
port
pathname
search
hash
name
target
alt
coords
shape
download
rel
HTMLBaseElement
function
HTMLBodyElement
function
HTMLBRElement
function
HTMLCanvasElement
function
prototype
object
getContext
function
width
function
height
function
HTMLDivElement
function
HTMLDListElement
function
HTMLHeadElement
function
HTMLHeadingElement
function
HTMLHRElement
function
HTMLHtmlElement
function
HTMLImageElement
function
HTMLInputElement
function
prototype
[object Object]
checked
disabled
name
type
value
HTMLLIElement
function
HTMLLinkElement
function
HTMLMetaElement
function
HTMLModElement
function
HTMLOListElement
function
HTMLOptionElement
function
HTMLParagraphElement
function
HTMLPreElement
function
HTMLQuoteElement
function
HTMLScriptElement
function
HTMLSpanElement
function
HTMLStyleElement
function
HTMLTableElement
function
HTMLTableCaptionElement
function
HTMLTableColElement
function
HTMLTableDataCellElement
HTMLTableRowElement
function
HTMLTableSectionElement
function
HTMLTextAreaElement
function
HTMLTitleElement
function
HTMLUListElement
function
BoxInfo
function The properties of a box, can be accessed after document conversion has finished - see
The Box Tracking API .
prototype
[object Object]
type
function "BODY" | "COLUMN" | "FLEXLINE" | "FOOTNOTES" | "FLOATS" | "BOX" | "LINE" | "SPAN" | "TEXT" | "SVG" | "IMAGE"
pageNum
x
function x-coordinate, in pt
y
function y-coordinate, in pt
w
h
marginBottom
function the used value for the bottom margin
marginLeft
function the used value for the left margin
marginRight
function the used value for the right margin
marginTop
function the used value for the top margin
floatPosition
children
function array of child boxes
parent
element
function DOM element for box (may be null)
pseudo
function pseudo-element name or null
text
string
style
function CSS style object for box
BoxInfoChildren
Prince
addEventListenertype, callback, optional extra options
function can be called to listen to the
complete
event on the Prince object. See
Event Handling .
type
string
callback
string
optional extra options
string
oncomplete
The complete
event is fired when all layout is finished (and after the last repeated layout, if this was requested), just before the PDF is output, so that it can cancel the PDF output by triggering a fail-safe if necessary, or log information about the PDF like the page count.
addScriptFuncname, function
trackBoxes
convertToFileJSON, OutputFileName, ...optional extra job resources
function boolean, indicating success
convertToBufferJSON, ...optional extra job resources
function ArrayBuffer if successful, null if not
failStatus
pageCount
function Total number of document pages, can be accessed after document conversion has finished.
registerPostLayoutFuncfunction
Log
debugmessage
function only available when the --debug
command-line option is specified.
infomessage
function only available when the --verbose
command-line option is specified.
warningmessage
errormessage
dataname, value
PDF
colorOptions
attachFileURL, description, filename, relationship
function
URL
string
description
string
Optional second argument to describe the attachment.
filename
string
Optional third argument to specify the filename to be displayed for the attachment in the PDF.
relationship
string
Optional fourth argument to specify the AFRelationship value of the attachment.
PDF.attachFile('data.xls', 'Latest sales figures.', 'SalesFigures', 'Data') embedFonts
subsetFonts
artificialFonts
forceIdentityEncoding
compress
encrypt
userPassword
ownerPassword
allowPrint
allowModify
allowCopy
allowAnnotate
keyBitskey bits
function
key bits
string
"40" | "128"
script
openAction
pageLayout
pageMode
printScaling
duplex
profile
function PDF.profile("PDF/X-3:2003") outputIntentURL
objectStreams
function Can be used to disable PDF object streams. Object streams are enabled by default.
fallbackCMYKProfileURL
colorConversion
paperTray
filterResolutiondpi
function PDF.filterResolution('128dpi') xmpURL
xmpMetadata
title
subject
author
keywords
creator
lang
pages
array A list of page boxes, can be accessed after document conversion has finished.
Log
debugmessage
function only available when the --debug
command-line option is specified.
infomessage
function only available when the --verbose
command-line option is specified.
warningmessage
errormessage
dataname, value