PDF JS Viewer

(part of package 'Servoy PDF Viewer') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

pdfJsViewer provides more control and customization options than pdfViewer. It is more flexible and can handle advanced features like drawing and digital signatures. If customization is not required, consider using pdfViewer.

This is a reference page; many components have detailed usage guides here.

Properties

dataProviderID

Bound data provider identifier for the PDF document. Type: Dataprovider


documentURL

URL of the document to be displayed. Type: String


enableTooltips

Flag indicating whether tooltips are enabled in the PDF viewer. Type: Boolean Default Value: false


noCache

When true, prevents caching of the PDF document. Type: Boolean


pageNumber

The current page number displayed in the viewer. Type: Number


showToolbar

Flag indicating whether the toolbar is displayed. Type: Boolean Default Value: true


styleClass

CSS style classes applied to the PDF viewer component. Type: Styleclass


styleSheet

Media or style sheet applied to the PDF viewer. Type: Media


tabSeq

Tab sequence order for keyboard navigation. Type: Tabseq


visible

Flag indicating whether the PDF viewer is visible. Type: Visible


zoomLevel

The zoom level for displaying the PDF document. Type: String


Events

onPageChanged(pageNumber,previousPageNumber)

Fired when the page in the PDF viewer changes.

Parameters:

  • {Number} pageNumber The page number of the new page that is displayed.

  • {Number} previousPageNumber The page number of the page that was previously displayed.


API

getFieldNames()

Returns an array of strings representing the field names.

Returns: Array<String> An array of field names.


getFieldValues()

Returns a map containing the field values.

Returns: Map A map of field values.


getToolbarControlIds()

Returns an array of strings representing the toolbar control IDs.

This should not be used at runtime because it can only be called when the view is visible. It is intended for developers to get the names that the current pdfjs viewer internal component supports, which can then be used in the solution.

Returns: Array<String> An array of toolbar control IDs.


reload()

forces a reload of the current url


setFieldControlsVisibility(names,visible)

Sets the visibility of the field controls.

Parameters:

  • {Array<String>} names - An array of field control names.

  • {Boolean} visible - A boolean indicating the visibility of the field controls.


setFieldValues(values)

Sets the field values.

Parameters:

  • {Map} values - A map containing the field values to be set.


setToolbarControlsVisibility(ids,visible)

Sets the visibility of the toolbar controls.

Parameters:

  • {Array<String>} ids - An array of toolbar control IDs.

  • {Boolean} visible - A boolean indicating the visibility of the toolbar controls.



Last updated

Was this helpful?