Skip to main content
Version: 4.60

pdf

The pdf layer displays a PDF file.

Field Configurations

KeyTypeDescriptionDefault Value
"additionalHeaders"AdditionalHeadersAdditional HTTP headers to send.null
"allowZoom"BooleanAllows zooming in the PDF."false"
"errorMessage"StringError message to show, if the PDF could not be loaded.null
"font"StringFont for error message. Default value varies depending on the OS and settings.null
"fontColor"ColorFontcolor of the error message. Default value varies depending on the OS and settings."#000000"
"fontSize"UnitSizeFont size of error message. Default value varies depending on the OS and settings.null
"linkEvent"StringEvent to fire if a link is clicked.null
"linkRegex"StringRegex groups that match the link will be used as event parameters (Parameter names: group0, group1, ...).null
"progressBarBackground"ColorThe background color of the progress bar when a pdf is loaded.null
"progressBarColor"ColorThe color of the progress bar when a pdf is loaded.null
"scrollDirection"ScrollDirectionDefines in what direction the pages can be scrolled."horizontal"
"value"StringThe URL to the PDF file.null

Inherited

From Base Layer

Base Layer

Field Configurations

KeyTypeDescriptionDefault Value
"_value"Value[PREVIEW] Dynamic value of the layer.null
"accessibilityAppendState"StringDefines this layer appends its state to the accessibility text.null
"accessibilityText"StringText for accessibility navigation. Can be translated.null
"actions"ActionListList of actions, which will be executed when the layer is tapped.null
"borderColor"ColorThe color of the border in hex color value.null
"borderRadius"UnitSizeThe radius applies to all corners; with a borderWidth of 0 the border is not drawn and radius is set anyway.0
"borderWidth"UnitSizeThe width of the border.0
"bottomLeftRadius"UnitSizeRadius for the bottom left corner.0
"bottomRightRadius"UnitSizeRadius for the bottom right corner.0
"classes"ArrayList of classes for layer styles.null
"conditions"ConditionsList of conditions to alter the layer state.null
"constraints"ConstraintsA list of constraints defining the position of the layer in a layout.null
"consumesKeyboard"BooleanThis layer will be used to shrink, if a keyboard is shown.null
"dataKey"StringName for assigning data to this layer.null
"focusColor"ColorThe highlight color of this layer when it is focused. Mainly used on TV. If no color is provided, the pressedColor will be used.null
"hidden"BooleanIndicates whether the layer is hidden. Default: false.false
"isAccessibilityElement"StringDefines if this layer is important for accessibility navigation. The default depends on the layer type.null
"layerRotation"NumberThe layer is rotated by the specified degree.0
"name"StringUnique name in the layout. Used for alignment or actions.null
"opacity"NumberThe opacity of the layer.1
"overInsetBottom"BooleanDetermines if this layer ignores the save space at the bottom of the device.false
"overInsetTop"BooleanDetermines if this layer ignores the save space at the top of the device.false
"pressedColor"ColorThe highlight color of this layer when it is pressed. Mainly used on TV. If no color is provided, the focusColor will be used.null
"safeArea"SafeAreaTypeObjectDetermines the safe area behaviour.null
"shadowElevation"NumberThe elevation of this layer for casting shadows.0
"state"StringThe state the layer will use as default."default"
"states"LayerStatesA list of named states that affect the appearance of the layer.null
"topLeftRadius"UnitSizeRadius for the top left corner.0
"topRightRadius"UnitSizeRadius for the top right corner.0
"touchFeedback"TouchFeedbackDetermines if the layer should show a touch feedback if touched."visible"
"trackingKey"StringDefines a key for a scroll event.null
"type"LayerTypeThe type of the layernull
"value"Value(Initial) value of the layer.null

Examples

Example 1: Display a PDF file.

Goal: Create a pdf layer that displays a PDF file with enabled zoom and horizontal scrolling.

To achieve this the following code can be used:

{
"type": "pdf",
"value": "https://fabrik19.de/wp-content/uploads/2021/07/Produktkatalog-Fabrik19-eGovernment.pdf",
"scrollDirection": "horizontal",
"allowZoom": true,
"classes": [
"fullSize"
]
}

The fields scrollDirection and allowZoom determine how the user can interact with the displayed PDF file.

Result:

Screencapture of the app showing the results of the sample code from Example 1.
A pdf layer with horizontal scrolling and enabled zoom has been created.