Docs / Guides

Markdown

The viewer

A complete editing screen: header, ribbon tabs, tool row, side panels and the pages.

Layout

  • Header: menu (open, download, save, import and export annotations, flatten), thumbnails, zoom, the ribbon tabs, Open, Save, search and comments.
  • Tool row: the tools of the open tab, followed by the style palette, undo, redo and the eraser.
  • Panels: thumbnails, comments, search, the Style panel, stamps and signatures.
  • Pages: scroll, zoom, a floating page navigator, and hover tips on annotations.
TabTools
Edit Text (PDF)Edit the PDF’s own text like a Word document: click any text and type; font, size, bold, italic, underline, colour, alignment; move or widen a block; add new text; delete text. Its pictures too: drag to move, handles to resize, turn, replace, delete, add an image. Tables: draw one, type in its cells (Tab to the next), drag its edges, add or delete rows and columns, cell and border colours
ViewPrevious and next page, rotate, fit width, fit page, page layout (single, double, cover and double), continuous or page-by-page scrolling, light and dark theme
AnnotateHighlight, underline, strike-out, squiggly, pen, highlighter, text box, insert text, replace text, sticky note
ShapesRectangle, ellipse, line, arrow, polygon, polyline, cloud, arc
InsertStamps, signature, image, add page
EditRotate, insert, delete and move pages, flatten
Fill and SignSignature, text, check mark, cross, dot, today’s date

In a PDF, Edit Text changes the page itself (not an annotation): the text keeps the PDF’s own font when it has the letters, else a real font is fetched (fontUrl) and included in the file; the page’s pictures move, resize, turn, change and go the same way. Word documents get Word’s own Edit Text tab with Word’s formatting tools; workbooks open in a spreadsheet grid with Excel’s Home tab, and the PDF tabs annotate the grid itself: marks sit on their cells, scroll and zoom with them, and show on Home too, where a click picks one up to move, restyle or delete it (a click beside it edits the cells). One undo covers the cells and the marks, in the order they changed.

Options

OptionMeaning
document, fileName, passwordThe file to open
themelight, dark or auto
accentColorYour brand colour, e.g. #0a7d5a
authorName written into new annotations
readOnlyView only, no editing tools
toolsTools to show, e.g. ['highlight', 'note', 'ink']
initialTabview, annotate (default), shapes, insert, edit, sign or pdftext (Edit Text in a PDF)
initialZoomA number (default 1.25), fitWidth or fitPage
layoutPage layout: single (default), double (two pages side by side) or cover (the first page alone, then two side by side)
scrollModecontinuous (default) or page (one page, or pair, at a time)
disabledElementsHide parts: open, save, download, search, comments, thumbnails, tabs, toolbar, tab:<id>, tool:<name> and more
headerButtonsYour own buttons: [{ id, label, title, icon, onClick(viewer) }]
onSave(bytes, info)Save handler, e.g. upload to your server (default: download)
fontUrlWhere to fetch fonts for Word and Excel files, and for PDFs whose fonts are not included
licenseKeyYour DocuVerse Web SDK licence key (a Mobile SDK key with appId). Without a key no document opens (the viewer shows where to get one); a trial key, from a free account, works with a watermark. A key for another SDK, like a Server SDK key, is refused: the viewer says which key to make
licenseServerAnother licence server than the one the key names (false: none). The key is checked there; it lists the website or app it runs in and how many documents were opened (counts only); a revoked or ended licence shows the watermark, a renewed one is picked up by itself
appIdIn a mobile app (the viewer in a web view): the app’s id, like com.acme.reader; the key must be for mobile apps and name the app
wasmWhere to load uds_pdf.wasm from

Methods

loadDocument(src, { fileName, password }), save({ incremental }), download(), setTool(name), getTool(), setRibbon(tab), setZoom(n | 'fitWidth' | 'fitPage'), goToPage(i), setLayout('single' | 'double' | 'cover'), setScrollMode('continuous' | 'page'), getLayout(), setTheme(), disableElements([...]), enableElements([...]), addHeaderButton({...}), openPanel('comments' | 'search' | 'thumbnails'), closePanel(), getDocument(), refresh(), destroy().

Events

viewer.on('annotationsChanged', (detail, viewer) => {  const json = viewer.getDocument().exportAnnotations();  localStorage.setItem('draft', JSON.stringify(json));});// documentLoaded · annotationsChanged · annotationCreated · selectionChanged · toolChanged · pageChanged · layoutChanged · save

Keyboard

V select, H highlight, U underline, N note, T text box, I insert text, P pen, R rectangle, O ellipse, L line, A arrow, E eraser; Ctrl/Cmd + Z, Shift + Z, S, F and O.