skjemapdfviewer module

class SkjemapdfViewer(form_identifier, pdf_folder_path)

Bases: ABC

Module for displaying PDF forms in a tab.

Parameters:
  • form_identifier (str)

  • pdf_folder_path (str)

label

Label for the tab, displayed as “🗎 Skjema”.

Type:

str

pdf_folder_path

Path to the folder containing the PDF files.

Type:

str

is_valid(form_identifier)

Validate the form identifier and PDF folder path.

Parameters:

form_identifier (str) – The identifier for the form.

Raises:

ValueError – If the form identifier is not found in the VariableSelector.

Return type:

None

abstract layout()

Define the layout for the FreeSearch module.

This is an abstract method that must be implemented by subclasses to define the module’s layout.

Returns:

A Dash HTML Div component representing the layout of the module.

Return type:

html.Div

module_callbacks()

Register Dash callbacks for the SkjemapdfViewer module.

Return type:

None

Notes

  • The first callback updates the form identifier input field.

  • The second callback fetches and encodes the PDF file as a data URI for display in the iframe.