Element type: Dictionary
Availability: 2.0.6+
This component wil display a PDF document for the given URL (online or local).
Since Octory 3.1.0, the document is scaled to fit the width of the component when it is displayed, instead of using the PDF's own scale.
A zoom control appears in the bottom trailing corner of the component when the end user moves the pointer over it, with a zoom out, a fit to width and a zoom in button. The document can also be zoomed with a pinch on the trackpad, up to four times its fitted size. The control stays permanently visible when VoiceOver or Switch Control is turned on.
Keys
| Name | Type | Possible values | Required |
|---|---|---|---|
| Type | String | PDF | Required |
| URL | String | - | Required |
| LinksAreEnabled | Boolean | - | |
| Margins | Dictionary (Margins) | - | |
| Border | Dictionary (Border) | - | |
| Condition PRO | Dictionary (Condition) | - |
Detail
Type Required
Type: String
Explanation: The type of the component which has to be PDF.
URL Required
Type: String
Explanation: The URL of the PDF document to display. Can be local or online.
LinksAreEnabled
Type: Boolean
Default: false
Explanation: If true, the link annotations in the PDF will be deactivated, preventing the user to open the URL and leave the app.
The plain URLs are automatically detected by the sytem, which will offer to preview and then open them. This behaviour could not be prevented so be careful with plain URLs in the PDF document if the user should not leave Octory.
Margins
Type: Dictionary (Margins)
Explanation: Add padding to the component's sides.
Border
Type: Dictionary (Border)
Explanation: Add a top or bottom border to a component.
Condition PRO
Type: Dictionary (Condition)
Explanation: Allows to hide or show the component using a boolean expression.
Example
Using an online PDF.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>PDF</string>
<key>URL</key>
<string>https://www.octory.io/terms-and-conditions.pdf</string>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>
Locale PDF with a variable Docs in its URL. For instance, Docs could be /Users/jappleseed/Application Support/Octory/Resources/Docs. The links are enabled.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Image</string>
<key>URL</key>
<string>${Docs}/welcome.pdf</string>
<key>LinksAreEnabled</key>
<true/>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>