Reconcile Document PDF Viewer

Overview

For use cases when needing to display bounding boxes within a pdf and provide auto-scrolling to those locations from interface actions.

Key Features & Functionality

Parameters:

  • documentUrl - URL of document using document(<id>, "url")
  • boundingBoxesDocumentUrl - URL of document using document(<id>, "url"), use either this or boundingBoxes
  • boundingBoxes - List of bounding boxes dictionaries containing an id and geometry (top, left, width, height), use either this or boundingBoxDocumentUrl
  • interactionId - value that should be incremented with each action outside of the component plugin that should force the component plugin to update, for example updating a highlightedBoxId to force scrolling.
  • highlightedBoxId - The ID of the bounding box that should be highlighted in the component plugin. If interactionId is updated alongside this value, the UI will scroll.
  • clickedBoundingBox - The ID of the bounding box that the user clicked within the component plugin

Example Usage:

reconcileDocumentViewer(
documentUrl: document(
<docId>,
"url"
),
boundingBoxes: {
a!map(
id: "<bounding box ID>",
text: "<text in box (used for search)>",
pageNumber: <page number of box>,
geometry: {left: <left coord>, top: <top coord>, width: <width>, height: <height>}
),
...more bounding boxes
},
interactionIdValue: local!interactionId, /* Just provide a local variable seeded with -1 */
interactionIdSaveInto: local!interaction,
highlightedBoxId: ri!highlightedBox, /* This controls which box id is highlighted */
clickedBoundingBox: ri!selectedBox /* This is which box id was clicked in the viewer */
)

Anonymous
Parents Comment Children
No Data