PDF Viewer

The PDF Viewer widget supports basic capabilities such as keyword search with text highlighting and auto-scroll on match, as well as more complex capabilities such as the ability to display, create, and interact with text and area annotations, enabling user tagging workflows.

PDF Viewer PDF Viewer with annotations.

The capability provides many enhanced functionalities including, but not limited to, the following:

  • Accepting string variables for keyword matches throughout the document.
  • Built-in search functionality for keyword matches provided by user.
  • Match highlighting (green for current match; purple for others) and hit count display.
  • Snaps to first result and between other hits.
  • Supports MediaReferences (media sets).
  • Displaying existing annotation objects.
  • Creating annotations through configured actions.
  • Customizable annotation interactions including events on selection, property display tooltips, and custom color highlighting.

Configuration options

The widget configuration supports several media input sources along with variable inputs for page numbers and text. The variable page number input will navigate users to the specified page within the PDF. The configured text input will be populated into the search bar, and a keyword search will be executed against that term. Even without configuring the widget, you can still manually enter any search term in the PDF view. To begin configuring annotations on the PDF document, select the Enable annotation option and refer to the Configure annotations section.

Choose a media source from the top of the configuration page to add a PDF to the widget. The configuration panel for a newly created PDF Viewer widget.
  • Configure PDF sourcing options:

    • Select the desired media source to populate the widget with a PDF. The dropdown will provide a list of supported media sources available to you. Currently supported media sources are Compass, datasets, media references, and attachments. Once the media source is selected, configuration for that media source will be available. Example media sources may include:
      • Compass: Uses the Palantir file system as a media source for PDFs. When selecting this option, provide the following:
        • Blobster RID: A string variable to specify the Blobster RID for the desired PDF.
      • Dataset: Uses a dataset as a media source for PDFs. When selecting this option, provide the following:
        • Dataset RID: A string variable to specify the RID of the dataset that contains the desired PDF.
        • File Path: A string variable to specify the file path within the dataset of the desired PDF.
        • Branch: A string variable to specify the branchID for the dataset. If no branch is specified, this will default to the master branch.
      • Media reference: Define an object set with a single object and select the media reference typed property for the PDF.
        • Object set with a single object: An object set variable for the desired PDF. The object set selected must contain a single object.
        • Property: The desired media reference typed property from the selected object set for the desired PDF.
      • Attachments: Define an object set with a single object and select the attachment property as a media source for PDFs. When selecting this option, provide the following:
        • Object set with a single object: An object set variable for the desired PDF. The object set selected must contain a single object.
        • Property: The desired attachment property from the selected object set for the desired PDF.
  • Configure input variables:

    • Customize starting page: Add a numeric variable to navigate users to the specified page number within the PDF. This will be the page displayed to users when accessing the widget. If no variable is provided, the first page of the PDF will be displayed.
    • Customize initial search: Add a string variable to prepopulate the keyword used to search within the widget.
  • Configure annotations:

    • Display existing annotations: A single annotation object set may be configured per layer. To enable annotations, at least one layer must be added and configured. Each layer has the following configurable fields:
      • Annotation layer name: Sets the name for the annotation layer. Note that this name field is only displayed within the widget's configuration panel.
      • Object set: Input the annotation object set to be displayed within the layer.
      • Page property: Select the integer object property specifying which page of the PDF the annotation object is on.
      • Bounding box(es) property: Select the string array object property specifying the coordinates of the bounding box(es) of the annotation object. Each string element in the array should be a stringified JSON object representing the top left (x1, y1) and bottom right (x2, y2) corners of the bounding box.
        • An array is required because annotations can have multiple bounding boxes. For example, three lines of text would require three bounding boxes, one for each line. A valid bounding box property may look like [ "{"x1":0.0, "y1":2.5, "x2":50.0, "y2":10.1}", "{"x1":2.0, "y1":12, "x2":35.0, "y2":14.2}" ].
      • Selected annotations: Select an object set to use both as the input for what annotation objects should be initially selected and as the output containing the currently selected annotation(s) on the document.
      • On select event: Configure Workshop events to trigger on selection of an annotation.
      • Properties to display in tooltip: Add properties to be displayed in the tooltip popover when an annotation in this layer is selected.
      • Highlight color:
        • Static: Set a static color to be used for the display of all annotations within the layer.
        • Color property: Set a string object property specifying the highlight coloring for annotations within the layer. The string property must be formatted as a color hex code (for example, "#FBD065"). If the string property does not contain a valid hex code, then the highlight coloring will default to GOLD5 (#FBD065).
        • Custom rules: Specify conditional formatting rules to dictate the highlight coloring for annotations within the layer. If no configured conditional formatting rules are met, the color highlighting for an annotation will default to GOLD5 (#FBD065).
    • Create annotations (via Actions): Configure actions to run on new text and/or area selections.
      • Action Icon: Choose an icon that will represent this action in the action popover when a new selection is made.
      • Action Label: This label will show as a tooltip when hovering over an action in the action popover. If no icon is set for this action, this label will be displayed in the action popover.
      • Use for selection type: Specify whether this action should show up in the action popover for text selections, area selections, or both.
      • Action on annotation: Set an action that can be triggered from the action popover. For more details on Actions in general, review our action type documentation.
        • When configuring Action parameters, data from the current text or area selection may be referenced using special parameter values:
          • Page number: The page number of the document of the current text or area selection. This option may be selected for integer parameters.
          • Selection coordinates: The array of strings representing the bounding box(es) of the current text or area selection. This option may be selected for string array parameters.
          • Highlighted text: The string content of the selection for text selections. Note that for area selections, the value will be an empty string. This option may be selected for string parameters.
  • Configure more options:

    • Output user selected text: Toggle to enable/disable capturing of a user’s text selections within a string variable as output from the widget.
    • Enable PDF downloads: Toggle to enable/disable download of the PDF displayed in the widget by users.