skjemapdfviewer module¶
- class SkjemapdfViewer(form_identifier, pdf_folder_path)¶
Bases:
ModuleBaseModule for displaying PDF forms in a tab.
- Parameters:
form_identifier (str)
pdf_folder_path (str)
- icon: str | Component¶
- implemented_as: Literal['Tab', 'Window'] | None¶
- 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
- label: str¶
- layout()¶
Generate the layout for the SkjemapdfViewer module.
- Returns:
- A Div element containing input fields for the form identifier
and an iframe to display the PDF content.
- Return type:
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.
- module_id: str¶
- module_layout: Div | Tab¶
- module_name: str¶
- module_number: int¶