{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://freepdfsdk.mecorelabs.com/schema/viewer-options.schema.json",
  "title": "Free PDF SDK viewer options",
  "description": "The options of FreePdf.init(element, options), without the callbacks (listeners).",
  "type": "object",
  "required": [
    "baseUrl"
  ],
  "additionalProperties": false,
  "properties": {
    "baseUrl": {
      "type": "string",
      "description": "URL of the folder holding viewer/ and version.json, on the page's own origin."
    },
    "document": {
      "description": "A PDF to open once ready: { url } (fetched by the page) or { data } (bytes, in JavaScript only).",
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "mode": {
      "enum": [
        "view",
        "review",
        "annotate",
        "fill",
        "sign",
        "organize",
        "edit",
        "full"
      ],
      "default": "view",
      "description": "A preset of features."
    },
    "features": {
      "type": "object",
      "description": "Turn features on or off on top of the mode's preset.",
      "additionalProperties": false,
      "properties": {
        "comments": {
          "type": "boolean",
          "description": "Sticky notes, text boxes, callouts, file attachments, replies, review status, the comment list and comment import/export."
        },
        "markup": {
          "type": "boolean",
          "description": "Highlight, underline, strikethrough, squiggly underline, insert (caret) and replace text."
        },
        "shapes": {
          "type": "boolean",
          "description": "Rectangles, ovals, lines, arrows, polygons, polylines and clouds."
        },
        "ink": {
          "type": "boolean",
          "description": "Freehand drawing and the eraser."
        },
        "stamps": {
          "type": "boolean",
          "description": "Standard and custom stamps."
        },
        "measurement": {
          "type": "boolean",
          "description": "Distance, perimeter and area measurements with a drawing scale."
        },
        "fillSign": {
          "type": "boolean",
          "description": "Typed text, checkmarks, crosses, dots, lines, dates, and drawn or typed signatures and initials placed on the page."
        },
        "formFill": {
          "type": "boolean",
          "description": "Filling in form fields, clearing a form, importing and exporting form data."
        },
        "formDesign": {
          "type": "boolean",
          "description": "Adding, editing and deleting form fields, text field tables, tab and calculation order, and field detection."
        },
        "digitalSignatures": {
          "type": "boolean",
          "description": "Signing and certifying with a digital ID (certificate)."
        },
        "signaturePanel": {
          "type": "boolean",
          "description": "The signatures panel: viewing and validating existing digital signatures."
        },
        "pages": {
          "type": "boolean",
          "description": "Insert, delete, rotate, move, duplicate, crop, replace and number pages."
        },
        "bookmarks": {
          "type": "boolean",
          "description": "Adding, renaming, moving and deleting bookmarks (viewing them is always on)."
        },
        "editContent": {
          "type": "boolean",
          "description": "Editing text and images, links, headers and footers, watermarks, backgrounds, Bates numbers and document properties."
        },
        "flatten": {
          "type": "boolean",
          "description": "Flattening comments and form fields into the page content."
        },
        "redaction": {
          "type": "boolean",
          "description": "Marking and applying redactions, sanitizing and removing hidden information."
        },
        "accessibility": {
          "type": "boolean",
          "description": "Accessibility checking, tags, reading order and alternate text."
        },
        "standards": {
          "type": "boolean",
          "description": "Converting to PDF/A, and removing a document's PDF/A or PDF/X identification."
        },
        "javascript": {
          "type": "boolean",
          "description": "Running the document's JavaScript, the console and editing scripts. Off unless you turn it on."
        },
        "security": {
          "type": "boolean",
          "description": "Adding or removing passwords and permissions."
        },
        "history": {
          "type": "boolean",
          "description": "Undo and redo of the changes the other features allow."
        },
        "save": {
          "type": "boolean",
          "description": "The viewer's own Save button; the PDF goes to your page in the saveRequested event."
        },
        "download": {
          "type": "boolean",
          "description": "Save As, saving optimized copies, attachments and reports from the viewer."
        },
        "export": {
          "type": "boolean",
          "description": "Exporting to Word, PowerPoint, images, HTML and text; extracting and splitting pages."
        },
        "print": {
          "type": "boolean",
          "description": "Printing."
        },
        "search": {
          "type": "boolean",
          "description": "Finding text in the document."
        },
        "copy": {
          "type": "boolean",
          "description": "Copying text and images (when the document allows it)."
        },
        "documentInfo": {
          "type": "boolean",
          "description": "The document properties dialog (read-only unless content editing is on) and word count."
        },
        "help": {
          "type": "boolean",
          "description": "Keyboard shortcuts and About."
        },
        "palette": {
          "type": "boolean",
          "description": "The \"Find tools and commands\" box and palette (Ctrl/Cmd+K)."
        },
        "preferences": {
          "type": "boolean",
          "description": "The preferences dialog, theme switching and rearranging panels."
        }
      }
    },
    "ui": {
      "type": "object",
      "description": "Show or hide parts of the interface.",
      "additionalProperties": false,
      "properties": {
        "toolsPanel": {
          "type": "boolean",
          "description": "The Tools panel on the left, listing the tool groups of the enabled features.",
          "default": true
        },
        "toolsRail": {
          "type": "boolean",
          "description": "A slim rail that brings the Tools panel back once it is closed.",
          "default": true
        },
        "quickToolbar": {
          "type": "boolean",
          "description": "The floating tool bar beside the page (Select, Hand and the enabled tools).",
          "default": true
        },
        "rightRail": {
          "type": "boolean",
          "description": "The right-hand rail: panel buttons, page navigation and zoom.",
          "default": true
        },
        "zoomControls": {
          "type": "boolean",
          "description": "Zoom and page display controls on the rail.",
          "default": true
        },
        "pageNavigation": {
          "type": "boolean",
          "description": "Page navigation on the rail.",
          "default": true
        },
        "menu": {
          "type": "boolean",
          "description": "The main menu button (File, Edit, View... with the enabled commands).",
          "default": true
        },
        "searchBox": {
          "type": "boolean",
          "description": "The \"Find tools and commands\" box in the top bar (needs the palette feature).",
          "default": true
        },
        "lockLayout": {
          "type": "boolean",
          "description": "Panels can't be moved, floated or closed from their tabs.",
          "default": false
        },
        "showPlannedTools": {
          "type": "boolean",
          "description": "Also list tools that are planned but not available yet.",
          "default": false
        },
        "externalLinks": {
          "type": "boolean",
          "description": "Links to web pages in documents may open (after a prompt).",
          "default": true
        },
        "panels": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "comments": {
              "type": "boolean",
              "description": "The comment list"
            },
            "bookmarks": {
              "type": "boolean",
              "description": "Bookmarks"
            },
            "pages": {
              "type": "boolean",
              "description": "Page thumbnails"
            },
            "fields": {
              "type": "boolean",
              "description": "Form fields"
            },
            "layers": {
              "type": "boolean",
              "description": "Layers"
            },
            "attachments": {
              "type": "boolean",
              "description": "File attachments"
            },
            "signatures": {
              "type": "boolean",
              "description": "Digital signatures (needs signaturePanel)"
            },
            "accessibility": {
              "type": "boolean",
              "description": "Accessibility checker (needs accessibility)"
            },
            "tags": {
              "type": "boolean",
              "description": "Structure tags (needs accessibility)"
            },
            "search": {
              "type": "boolean",
              "description": "Advanced search results (needs search)"
            }
          }
        }
      }
    },
    "disabledElements": {
      "type": "array",
      "items": {
        "enum": [
          "download",
          "save",
          "print",
          "open",
          "flatten",
          "settings",
          "import",
          "tool:note",
          "tool:freetext",
          "tool:callout",
          "tool:highlight",
          "tool:underline",
          "tool:strikeout",
          "tool:squiggly",
          "tool:caret",
          "tool:replace",
          "tool:ink",
          "tool:line",
          "tool:arrow",
          "tool:square",
          "tool:circle",
          "tool:polygon",
          "tool:polyline",
          "tool:cloud",
          "tool:attach",
          "tool:stamp",
          "tool:image",
          "tool:link",
          "tool:measure",
          "tool:fillsign",
          "tool:signature"
        ]
      },
      "uniqueItems": true,
      "maxItems": 256
    },
    "author": {
      "type": "string",
      "maxLength": 200,
      "description": "Author of new comments."
    },
    "theme": {
      "enum": [
        "light",
        "dark",
        "system"
      ],
      "default": "system"
    },
    "password": {
      "type": "string",
      "maxLength": 1024,
      "description": "Opens a password-protected document and lifts owner restrictions."
    },
    "locale": {
      "type": "string",
      "maxLength": 35,
      "description": "Interface language, such as en, de or zh-Hans."
    },
    "timeoutMs": {
      "type": "integer",
      "minimum": 1,
      "default": 60000
    }
  }
}
