JavaScript Support
Prince supports most of ECMAScript 5th edition, including strict mode, and ECMAScript 6th edition classes. 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 (*) 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
object
The global object
BoxInfo
function
The properties of a box, can be accessed after document conversion has finished - see The Box Tracking API.
CSSStyleDeclaration
function
prototype
object
accentColor
See the property accent-color.
alignContent
See the property align-content.
alignItems
See the property align-items.
alignSelf
See the property align-self.
all
See the property all.
background
See the property background.
backgroundAttachment
See the property background-attachment.
backgroundClip
See the property background-clip.
backgroundColor
See the property background-color.
backgroundImage
See the property background-image.
backgroundImageResolution
See the property background-image-resolution.
backgroundOrigin
See the property background-origin.
backgroundPosition
See the property background-position.
backgroundRepeat
See the property background-repeat.
backgroundSize
See the property background-size.
baselineShift
See the property baseline-shift.
bookmarkLabel
See the property bookmark-label.
bookmarkLevel
See the property bookmark-level.
bookmarkState
See the property bookmark-state.
bookmarkTarget
See the property bookmark-target.
border
See the property border.
borderBottom
See the property border-bottom.
borderBottomColor
See the property border-bottom-color.
borderBottomLeftRadius
See the property border-bottom-left-radius.
borderBottomRightRadius
See the property border-bottom-right-radius.
borderBottomStyle
See the property border-bottom-style.
borderBottomWidth
See the property border-bottom-width.
borderClip
See the property border-clip.
borderCollapse
See the property border-collapse.
borderColor
See the property border-color.
borderLeft
See the property border-left.
borderLeftColor
See the property border-left-color.
borderLeftStyle
See the property border-left-style.
borderLeftWidth
See the property border-left-width.
borderRadius
See the property border-radius.
borderRight
See the property border-right.
borderRightColor
See the property border-right-color.
borderRightStyle
See the property border-right-style.
borderRightWidth
See the property border-right-width.
borderSpacing
See the property border-spacing.
borderStyle
See the property border-style.
borderTop
See the property border-top.
borderTopColor
See the property border-top-color.
borderTopLeftRadius
See the property border-top-left-radius.
borderTopRightRadius
See the property border-top-right-radius.
borderTopStyle
See the property border-top-style.
borderTopWidth
See the property border-top-width.
borderWidth
See the property border-width.
bottom
See the property bottom.
boxDecorationBreak
See the property box-decoration-break.
boxShadow
See the property box-shadow.
boxSizing
See the property box-sizing.
breakAfter
See the property break-after.
breakBefore
See the property break-before.
breakInside
See the property break-inside.
captionPage
See the property caption-page.
captionSide
See the property caption-side.
clear
See the property clear.
clip
See the property clip.
clipPath
See the property clip-path.
clipRule
See the property clip-rule.
color
See the property color.
colorInterpolation
See the property color-interpolation.
colorInterpolationFilters
See the property color-interpolation-filters.
columnBreakAfter
See the property column-break-after.
columnBreakBefore
See the property column-break-before.
columnCount
See the property column-count.
columnFill
See the property column-fill.
columnGap
See the property column-gap.
columnRule
See the property column-rule.
columnRuleColor
See the property column-rule-color.
columnRuleStyle
See the property column-rule-style.
columnRuleWidth
See the property column-rule-width.
columnSpan
See the property column-span.
columnWidth
See the property column-width.
columns
See the property columns.
content
See the property content.
counterIncrement
See the property counter-increment.
counterReset
See the property counter-reset.
counterSet
See the property counter-set.
cssFloat
See the property float.
direction
See the property direction.
display
See the property display.
dominantBaseline
See the property dominant-baseline.
emptyCells
See the property empty-cells.
fill
See the property fill.
fillOpacity
See the property fill-opacity.
fillRule
See the property fill-rule.
filter
See the property filter.
flex
See the property flex.
flexBasis
See the property flex-basis.
flexDirection
See the property flex-direction.
flexFlow
See the property flex-flow.
flexGrow
See the property flex-grow.
flexShrink
See the property flex-shrink.
flexWrap
See the property flex-wrap.
floatDeferColumn
See the property float-defer-column.
floatDeferPage
See the property float-defer-page.
floatModifier
See the property float-modifier.
floatPlacement
See the property float-placement.
floatPolicy
See the property float-policy.
floatReference
See the property float-reference.
floatTail
See the property float-tail.
floodColor
See the property flood-color.
floodOpacity
See the property flood-opacity.
flow
See the property flow.
font
See the property font.
fontFamily
See the property font-family.
fontFeatureSettings
See the property font-feature-settings.
fontKerning
See the property font-kerning.
fontSize
See the property font-size.
fontStretch
See the property font-stretch.
fontStyle
See the property font-style.
fontVariant
See the property font-variant.
fontVariantAlternates
See the property font-variant-alternates.
fontVariantCaps
See the property font-variant-caps.
fontVariantLigatures
See the property font-variant-ligatures.
fontVariantNumeric
See the property font-variant-numeric.
fontVariationSettings
See the property font-variation-settings.
fontWeight
See the property font-weight.
footnoteDisplay
See the property footnote-display.
footnoteStylePosition
See the property footnote-style-position.
gap
See the property gap.
grid
See the property grid.
gridArea
See the property grid-area.
gridAutoColumns
See the property grid-auto-columns.
gridAutoFlow
See the property grid-auto-flow.
gridAutoRows
See the property grid-auto-rows.
gridColumn
See the property grid-column.
gridColumnEnd
See the property grid-column-end.
gridColumnStart
See the property grid-column-start.
gridRow
See the property grid-row.
gridRowEnd
See the property grid-row-end.
gridRowStart
See the property grid-row-start.
gridTemplate
See the property grid-template.
gridTemplateAreas
See the property grid-template-areas.
gridTemplateColumns
See the property grid-template-columns.
gridTemplateRows
See the property grid-template-rows.
height
See the property height.
hyphenateAfter
See the property hyphenate-after.
hyphenateBefore
See the property hyphenate-before.
hyphenateLines
See the property hyphenate-lines.
hyphenatePatterns
See the property hyphenate-patterns.
hyphens
See the property hyphens.
imageOrientation
See the property image-orientation.
imageResolution
See the property image-resolution.
inset
See the property inset.
insetInside
See the property inset-inside.
insetOutside
See the property inset-outside.
justifyContent
See the property justify-content.
justifyItems
See the property justify-items.
justifySelf
See the property justify-self.
left
See the property left.
letterSpacing
See the property letter-spacing.
lightingColor
See the property lighting-color.
lineHeight
See the property line-height.
lineStackingStrategy
See the property line-stacking-strategy.
link
See the property link.
listStyle
See the property list-style.
listStyleImage
See the property list-style-image.
listStylePosition
See the property list-style-position.
listStyleType
See the property list-style-type.
margin
See the property margin.
marginAlt
See the property margin-alt.
marginBottom
See the property margin-bottom.
marginInside
See the property margin-inside.
marginLeft
See the property margin-left.
marginOutside
See the property margin-outside.
marginRight
See the property margin-right.
marginTop
See the property margin-top.
marker
See the property marker.
markerEnd
See the property marker-end.
markerMid
See the property marker-mid.
markerStart
See the property marker-start.
mask
See the property mask.
maxHeight
See the property max-height.
maxWidth
See the property max-width.
minHeight
See the property min-height.
minWidth
See the property min-width.
objectFit
See the property object-fit.
objectPosition
See the property object-position.
opacity
See the property opacity.
order
See the property order.
orphans
See the property orphans.
outline
See the property outline.
outlineColor
See the property outline-color.
outlineOffset
See the property outline-offset.
outlineStyle
See the property outline-style.
outlineWidth
See the property outline-width.
overflow
See the property overflow.
overflowWrap
See the property overflow-wrap.
padding
See the property padding.
paddingBottom
See the property padding-bottom.
paddingLeft
See the property padding-left.
paddingRight
See the property padding-right.
paddingTop
See the property padding-top.
page
See the property page.
pageBreakAfter
See the property page-break-after.
pageBreakBefore
See the property page-break-before.
pageBreakInside
See the property page-break-inside.
pageGroup
See the property page-group.
placeContent
See the property place-content.
placeItems
See the property place-items.
placeSelf
See the property place-self.
position
See the property position.
princeAltText
See the property -prince-alt-text.
princeBackgroundImageResolution
See the property -prince-background-image-resolution.
princeBookmarkLabel
See the property -prince-bookmark-label.
princeBookmarkLevel
See the property -prince-bookmark-level.
princeBookmarkState
See the property -prince-bookmark-state.
princeBookmarkTarget
See the property -prince-bookmark-target.
princeBorderClip
See the property -prince-border-clip.
princeCaptionPage
See the property -prince-caption-page.
princeClear
See the property -prince-clear.
princeExpansionText
See the property -prince-expansion-text.
princeFilterResolution
See the property -prince-filter-resolution.
princeFloatDeferColumn
See the property -prince-float-defer-column.
princeFloatDeferPage
See the property -prince-float-defer-page.
princeFloatModifier
See the property -prince-float-modifier.
princeFloatPlacement
See the property -prince-float-placement.
princeFloatPolicy
See the property -prince-float-policy.
princeFloatReference
See the property -prince-float-reference.
princeFloatTail
See the property -prince-float-tail.
princeFlow
See the property -prince-flow.
princeFootnoteDisplay
See the property -prince-footnote-display.
princeFootnotePolicy
See the property -prince-footnote-policy.
princeHyphenateAfter
See the property -prince-hyphenate-after.
princeHyphenateBefore
See the property -prince-hyphenate-before.
princeHyphenateCharacter
See the property -prince-hyphenate-character.
princeHyphenateLines
See the property -prince-hyphenate-lines.
princeHyphenatePatterns
See the property -prince-hyphenate-patterns.
princeHyphens
See the property -prince-hyphens.
princeImageMagic
See the property -prince-image-magic.
princeImageResolution
See the property -prince-image-resolution.
princeLang
See the property -prince-lang.
princeLineStackingStrategy
See the property -prince-line-stacking-strategy.
princeLinebreakMagic
See the property -prince-linebreak-magic.
princeLink
See the property -prince-link.
princeMarginAlt
See the property -prince-margin-alt.
princeMarginInside
See the property -prince-margin-inside.
princeMarginOutside
See the property -prince-margin-outside.
princePageGroup
See the property -prince-page-group.
princePdfAnnotationAuthor
See the property -prince-pdf-annotation-author.
princePdfAnnotationColor
See the property -prince-pdf-annotation-color.
princePdfAnnotationContents
See the property -prince-pdf-annotation-contents.
princePdfAnnotationCreatedate
See the property -prince-pdf-annotation-createdate.
princePdfAnnotationIcon
See the property -prince-pdf-annotation-icon.
princePdfAnnotationMerge
See the property -prince-pdf-annotation-merge.
princePdfAnnotationModifydate
See the property -prince-pdf-annotation-modifydate.
princePdfAnnotationPosition
See the property -prince-pdf-annotation-position.
princePdfAnnotationTitle
See the property -prince-pdf-annotation-title.
princePdfAnnotationType
See the property -prince-pdf-annotation-type.
princePdfColorConversion
See the property -prince-pdf-color-conversion.
princePdfDestination
See the property -prince-pdf-destination.
princePdfForm
See the property -prince-pdf-form.
princePdfFormFieldFontSize
See the property -prince-pdf-form-field-font-size.
princePdfFormFieldSettings
See the property -prince-pdf-form-field-settings.
princePdfLinkType
See the property -prince-pdf-link-type.
princePdfListNumbering
See the property -prince-pdf-list-numbering.
princePdfPageNumbering
See the property -prince-pdf-page-numbering.
princePdfSmartTypography
See the property -prince-pdf-smart-typography.
princePdfTagTitle
See the property -prince-pdf-tag-title.
princePdfTagType
See the property -prince-pdf-tag-type.
princeTabSize
See the property -prince-tab-size.
princeTableBaseline
See the property -prince-table-baseline.
princeTableColumnSpan
See the property -prince-table-column-span.
princeTableRowSpan
See the property -prince-table-row-span.
princeTextAlignAll
See the property -prince-text-align-all.
princeTextJustify
See the property -prince-text-justify.
princeTextReplace
See the property -prince-text-replace.
princeTooltip
See the property -prince-tooltip.
right
See the property right.
rowGap
See the property row-gap.
stopColor
See the property stop-color.
stopOpacity
See the property stop-opacity.
stringSet
See the property string-set.
stroke
See the property stroke.
strokeDasharray
See the property stroke-dasharray.
strokeDashoffset
See the property stroke-dashoffset.
strokeLinecap
See the property stroke-linecap.
strokeLinejoin
See the property stroke-linejoin.
strokeMiterlimit
See the property stroke-miterlimit.
strokeOpacity
See the property stroke-opacity.
strokeWidth
See the property stroke-width.
tabSize
See the property tab-size.
tableBaseline
See the property table-baseline.
tableColumnSpan
See the property table-column-span.
tableLayout
See the property table-layout.
tableRowSpan
See the property table-row-span.
textAlign
See the property text-align.
textAlignAll
See the property text-align-all.
textAlignLast
See the property text-align-last.
textAnchor
See the property text-anchor.
textDecoration
See the property text-decoration.
textDecorationColor
See the property text-decoration-color.
textDecorationLine
See the property text-decoration-line.
textDecorationStyle
See the property text-decoration-style.
textDecorationThickness
See the property text-decoration-thickness.
textIndent
See the property text-indent.
textJustify
See the property text-justify.
textLineThrough
See the property text-line-through.
textLineThroughColor
See the property text-line-through-color.
textLineThroughStyle
See the property text-line-through-style.
textOverflow
See the property text-overflow.
textOverline
See the property text-overline.
textOverlineColor
See the property text-overline-color.
textOverlineStyle
See the property text-overline-style.
textShadow
See the property text-shadow.
textTransform
See the property text-transform.
textUnderline
See the property text-underline.
textUnderlineColor
See the property text-underline-color.
textUnderlineOffset
See the property text-underline-offset.
textUnderlinePosition
See the property text-underline-position.
textUnderlineStyle
See the property text-underline-style.
top
See the property top.
transform
See the property transform.
transformOrigin
See the property transform-origin.
unicodeBidi
See the property unicode-bidi.
verticalAlign
See the property vertical-align.
visibility
See the property visibility.
whiteSpace
See the property white-space.
widows
See the property widows.
width
See the property width.
wordBreak
See the property word-break.
wordSpacing
See the property word-spacing.
writingMode
See the property writing-mode.
zIndex
See the property z-index.
Log
object
also available as
Prince.Log.Object
function
definePropertybase object, property name, descriptor
function
Adds a property to the object and defines certain traits like enumerability.
- base objectobject
- property namestring
- descriptorobjectAn object describing the property
Object.defineProperty(Array.prototype, 'myProp',
{enumerable: false})PDF
object
See The PDF Object.
attachFileURL, description, filename, relationship
function
- URLstring
- descriptionstringOptional second argument to describe the attachment.
- filenamestringOptional third argument to specify the filename to be displayed for the attachment in the PDF.
- relationshipstringOptional fourth argument to specify the AFRelationship value of the attachment.
PDF.attachFile('data.xls', 'Latest sales figures.', 'SalesFigures', 'Data')colorOptions
string
"auto" | "use-true-black" | "use-rich-black". See -prince-pdf-color-optionskeyBits
number
"40" | "128". See PDF Encryption and Document SecurityobjectStreams
boolean
Can be used to disable PDF object streams. Object streams are enabled by default.
Prince
object
See The Prince Object.
Log
object
also available as
Log.addEventListenertype, callback, optional extra options
function
can be called to listen to the
complete event on the Prince object. See Event Handling.- typestring
- callbackstring
- optional extra optionsstring
addScriptFuncname, function
function
exposes an arbitrary JavaScript function to CSS. See Script Functions.
- namestring
- functionstring
convertToBufferJSON, ...optional extra job resources
function
- JSONstring
- ...optional extra job resourcesArrayBuffers or strings
ArrayBuffer if successful, null if not
convertToFileJSON, OutputFileName, ...optional extra job resources
function
- JSONstringas specified in the Job description JSON;
- OutputFileNamestring
- ...optional extra job resourcesArrayBuffers or strings
boolean, indicating success
pageCount
number
Total number of document pages, can be accessed after document conversion has finished.
decodeURIComponentURI
function
Decodes a Uniform Resource Identifier (URI) component.
- URIstringA component of a URI
string
encodeURIComponentURI
function
Encodes a Uniform Resource Identifier (URI) component.
- URIstringA component of a URI
string
escapestring
function
Computes a new string by replacing certain characters with a hexadecimal escape sequence.
- stringstringString to escape
string
evalsource
function
Evaluates text as JavaScript source code.
- sourcestringCode to evaluate
Result of evaluation
hasOwnPropertyproperty
function
Returns a boolean indicating whether the object has the specified property.
- propertystringThe property to test
boolean
isNaN
function
Checks if the argument's value is the special Not a Number value.
boolean
isNaN(parseInt('hello'))trueparseIntvalue, radix
function
Turns input into an integer number.
- valuestring
- radixnumberIndicates number base, for example 10 to parse input as a decimal value, 16 for hex values.
number
parseInt('50')50propertyIsEnumerable
function
Returns a Boolean indicating whether the specified property is enumerable.
boolean
toLocaleString
function
Converts an object to a string with a language sensitive representation of said string.
string