Web SDKv1.0.0

defaultTool

The resting tool. A document opens in Select, as it does in Acrobat, and every other tool goes back to it when it is put away — Escape, its button pressed again, the Close on a phone's sheet, a tool that finishes on its own. Select's button shows pressed and viewer.activeTool answers 'selectText' from that moment; toolChanged reports it once it has started, and is never told null in between. Select and Pan need no license feature and no document permission.

In Select, text is selected by dragging over it, which brings up the selection bar. Ctrl/Cmd+C (or the browser's Copy) copies the selection, unless the document forbids copying, a field has the focus, or the host page has a selection of its own or answered the copy itself. A press anywhere else — outside the viewer, on the pages off the text — lets go of the selection, and so do Escape and a zoom. Wherever the words leave the viewer — Copy and Ctrl/Cmd+C, Search for this, the first words of Add a note — the license rule of the accessible text layer applies: the extract feature, or a production license's clean output. On a development key without extract the bar has neither Copy nor Search for this, and a note starts empty. A click on an annotation selects it; over one, the pointer is the arrow, not the text cursor; Escape puts it down without leaving Select. Links and form fields answer as with no tool: a click follows a link, and a field takes the click and the typing. On touch, one finger scrolls the pages; a long press (half a second, held still) selects the word under it, with handles and the bar in the phone's sheet; a tap selects the annotation under it. A page's text is read when a mouse or pen first comes over that page, or a finger holds still on it — never when the document opens or is scrolled — and read again after a zoom.

tools.selectText: false (or pan: false for a Pan rest) leaves no tool active; any other value is ignored with a console warning.

'selectText' | 'pan' | nulldefault 'selectText'

Values

  • 'selectText'Default. Rest in Select: drag over text to select it, click an annotation to select it, links and fields answer as with no tool.
  • 'pan'Rest in Pan instead: drag to scroll, a click selects an annotation; links are not followed in Pan.
  • nullRest in no tool: the pages' own text selection and copy (see the accessible text layer), links and fields, and a click on an annotation still selects it.

Example

defaultToolTypeScript
new PDFViewer(container, doc, { defaultTool: 'pan' });

More in SDKMode and the resting tool