PDF kit command
file.setInitialView
Initial view
Read or change how the document opens (Document Properties ▸ Initial View) and its reading options: navigation (page, bookmarks, pages, attachments, layers), layout (default, single, continuous, two_up, two_up_continuous, two_up_cover, two_up_continuous_cover), magnification (default, actual, fit_page, fit_width, fit_height, fit_visible, or a percentage), page, window options (fitWindow, centerWindow, fullScreen, displayTitle), interface options (hideMenubar, hideToolbar, hideWindowUi), language and binding (left, right). Only the given ones change; returns the result. Undoable.
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
binding | "left" | "right" | no | |
centerWindow | boolean | no | |
displayTitle | boolean | no | |
fitWindow | boolean | no | |
fullScreen | boolean | no | |
hideMenubar | boolean | no | |
hideToolbar | boolean | no | |
hideWindowUi | boolean | no | |
language | string | no | |
layout | "default" | "single" | "continuous" | "two_up" | "two_up_continuous" | "two_up_cover" | "two_up_continuous_cover" | no | |
magnification | number | "default" | "actual" | "fit_page" | "fit_width" | "fit_height" | "fit_visible" | no | |
navigation | "page" | "bookmarks" | "pages" | "attachments" | "layers" | no | |
page | integer | no | (minimum 1) |
Call through pdf_run
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "file.setInitialView" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: binding, centerWindow, displayTitle, fitWindow, fullScreen, hideMenubar, hideToolbar, hideWindowUi, language, layout, magnification, navigation, page. pdf_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"binding": {
"enum": [
"left",
"right"
],
"type": "string"
},
"centerWindow": {
"type": "boolean"
},
"displayTitle": {
"type": "boolean"
},
"fitWindow": {
"type": "boolean"
},
"fullScreen": {
"type": "boolean"
},
"hideMenubar": {
"type": "boolean"
},
"hideToolbar": {
"type": "boolean"
},
"hideWindowUi": {
"type": "boolean"
},
"language": {
"type": "string"
},
"layout": {
"enum": [
"default",
"single",
"continuous",
"two_up",
"two_up_continuous",
"two_up_cover",
"two_up_continuous_cover"
],
"type": "string"
},
"magnification": {
"oneOf": [
{
"description": "percent from 1 to 6400",
"type": "number"
},
{
"enum": [
"default",
"actual",
"fit_page",
"fit_width",
"fit_height",
"fit_visible"
],
"type": "string"
}
]
},
"navigation": {
"enum": [
"page",
"bookmarks",
"pages",
"attachments",
"layers"
],
"type": "string"
},
"page": {
"description": "(minimum 1)",
"type": "integer"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (pdf_commands through @kition/[email protected], built from KitionAI/kition-pdf@b0d2725). As data: commands.jsonl.