PDF Viewer
A document viewer for PDF files — navigation, zoom, find, forms, annotations, signatures, comments, presentation mode and page organisation. The pages are pdf.js's own viewer; everything around them — toolbars, sidebar, find bar, dialogs — is your markup, with the viewer's parts on it.
Installation
It has its own entry point, @semantic-components/ui/pdf-viewer, built on pdfjs-dist — an optional peer of ui: install it where you use the component.
import { ScPdfViewer } from '@semantic-components/ui/pdf-viewer'; Import the viewer's stylesheet in your styles.css: @import '@semantic-components/styles/pdf-viewer.css'; — in place of pdf.js's pdf_viewer.css. It's pdf.js's, rebuilt for the library: what the pages need, the library's look on your theme's tokens, and without the :root { color-scheme: light dark } pdf.js's sets for the whole page (pdf.js issue 19886), which would hand scrollbars and native controls to the operating system's mode instead of your app's.
Then define the viewer's colours in your theme, as every colour of it — light on :root, dark under .dark: --sc-pdf-viewer-highlight-1 to -5, --sc-pdf-viewer-ink-1 to -4, --sc-pdf-viewer-page and --sc-pdf-viewer-page-foreground (see pdf.js, below).
pdf.js's own files — its worker, scripting sandbox, fonts, CMaps (Chinese, Japanese, Korean text), wasm image decoders, colour profiles and the icons of a document's notes — are served by your app, never by a CDN: copy them into your assets. The viewer looks for them at /pdfjs/; assetsUrl for elsewhere.
// angular.json: pdf.js's files, in the assets{ "glob": "{build/pdf.worker.min.mjs,build/pdf.sandbox.min.mjs,cmaps/**,standard_fonts/**,wasm/**,iccs/**,web/images/annotation-*.svg}", "input": "node_modules/pdfjs-dist", "output": "pdfjs"}Usage
import { Component, ViewEncapsulation, computed, input } from '@angular/core';import { ScEmpty, ScEmptyBody, ScEmptyHeader, ScEmptyTitle, ScInput,} from '@semantic-components/ui';import { ScPdfViewer, ScPdfViewerCanvas, ScPdfViewerContainer, ScPdfViewerContent, ScPdfViewerDownload, ScPdfViewerError, ScPdfViewerLoading, ScPdfViewerNav, ScPdfViewerNextPage, ScPdfViewerPageInput, ScPdfViewerPrevPage, ScPdfViewerRetry, ScPdfViewerSpacer, ScPdfViewerToolbar, ScPdfViewerZoom, ScPdfViewerZoomIn, ScPdfViewerZoomOut,} from '@semantic-components/ui/pdf-viewer';import { SiChevronDownIcon, SiChevronUpIcon, SiDownloadIcon, SiZoomInIcon, SiZoomOutIcon,} from '@semantic-icons/lucide-icons';import { cn } from 'cn';
/** A viewer with the essentials: pages, zoom, download. */@Component({ selector: 'app-pdf-viewer-usage-demo', imports: [ ScPdfViewer, ScPdfViewerContainer, ScPdfViewerToolbar, ScPdfViewerNav, ScPdfViewerPrevPage, ScPdfViewerNextPage, ScPdfViewerPageInput, ScPdfViewerSpacer, ScPdfViewerZoom, ScPdfViewerZoomOut, ScPdfViewerZoomIn, ScPdfViewerDownload, ScPdfViewerContent, ScPdfViewerLoading, ScPdfViewerError, ScPdfViewerRetry, ScPdfViewerCanvas, ScEmpty, ScEmptyHeader, ScEmptyTitle, ScEmptyBody, ScInput, SiChevronUpIcon, SiChevronDownIcon, SiZoomOutIcon, SiZoomInIcon, SiDownloadIcon, ], template: ` <div scPdfViewer class="size-full" src="/pdf/handbook.pdf" fileName="handbook" #viewer="scPdfViewer" > <div scPdfViewerContainer class="size-full"> <div scPdfViewerToolbar aria-label="Handbook"> <div scPdfViewerNav aria-label="Pages"> <button scPdfViewerPrevPage> <svg siChevronUpIcon></svg> <span class="sr-only">Previous page</span> </button> <button scPdfViewerNextPage> <svg siChevronDownIcon></svg> <span class="sr-only">Next page</span> </button> </div> <input scInput scPdfViewerPageInput aria-label="Page" /> <span class="text-muted-foreground text-sm"> ({{ viewer.currentPage() }} of {{ viewer.totalPages() }}) </span> <div scPdfViewerSpacer></div> <div scPdfViewerZoom aria-label="Zoom"> <button scPdfViewerZoomOut> <svg siZoomOutIcon></svg> <span class="sr-only">Zoom out</span> </button> <button scPdfViewerZoomIn> <svg siZoomInIcon></svg> <span class="sr-only">Zoom in</span> </button> </div> <button scPdfViewerDownload> <svg siDownloadIcon></svg> <span class="sr-only">Download</span> </button> </div> <div scPdfViewerContent> <div scPdfViewerLoading>Loading the handbook…</div> <div scEmpty scPdfViewerError> <div scEmptyHeader> <div scEmptyTitle>Couldn't open the document</div> </div> <div scEmptyBody> <button scPdfViewerRetry>Try again</button> </div> </div> <div scPdfViewerCanvas></div> </div> </div> </div> `, host: { '[class]': 'class()' }, encapsulation: ViewEncapsulation.None,})export class PdfViewerUsageDemo { readonly classInput = input<string>('', { alias: 'class' }); private readonly class = computed(() => cn('block h-dvh w-full', this.classInput()), );}Anatomy
The viewer holds the document and its state; the container frames it (and goes fullscreen); the canvas is pdf.js's viewer. The rest is yours — toolbars, a sidebar, a find bar, dialogs — with parts on your buttons, fields and lists. Parts find the viewer by their place: put them inside it, templates rendered elsewhere included.
import { ScPdfViewer, ScPdfViewerContainer, ScPdfViewerToolbar, ScPdfViewerContent, ScPdfViewerLoading, ScPdfViewerError, ScPdfViewerCanvas, ScPdfViewerAnnotationToolbar, ScPdfViewerAnnotationComment, ScPdfViewerAnnotationDelete, ScPdfViewerIcon,} from '@semantic-components/ui/pdf-viewer';<div scPdfViewer src="…" #viewer="scPdfViewer"> <div scPdfViewerContainer> <div scPdfViewerToolbar aria-label="…"> <button scPdfViewerPrevPage>…</button> <input scInput scPdfViewerPageInput aria-label="…" /> … </div> <div scPdfViewerContent> <div scPdfViewerLoading>…</div> <div scEmpty scPdfViewerError>…</div> <div scPdfViewerCanvas></div> <ng-template scPdfViewerAnnotationToolbar let-annotation> <button scPdfViewerAnnotationComment>…</button> <button scPdfViewerAnnotationDelete>…</button> </ng-template> <ng-template scPdfViewerIcon="comment">…</ng-template> </div> </div></div>pdf.js
- The pages are pdf.js's
PDFViewer, wired as pdf.js's viewer application wires it: rendering, text, links, forms (their scripts run in pdf.js's sandbox), structure for screen readers, find, scroll and spread modes, annotation editors, page organisation. - pdf.js's own words on the pages — its editors' toolbar buttons — are its English, or your app's language when your page links pdf.js's locale files. The library ships no other text: yours is yours to word and translate.
- The look is the library's: its stylesheet is pdf.js's, rebuilt — the pages in the style's frame, what pdf.js draws on them in the theme's colours, without pdf.js's application and its global
color-scheme. It has no images: the library draws no icons. The few pdf.js shows on the pages — the comment button by an annotation, a page being drawn… — are your templates (scPdfViewerIcon), stamped into pdf.js's elements; its editing cursors are plain, and--sc-pdf-viewer-…-cursorvariables take yours. Annotation colours are the theme's CSS variables —--sc-pdf-viewer-highlight-1to-5,--sc-pdf-viewer-ink-1to-4— in oklch, light on:rootand dark under.dark. - Those colours are written into the PDF, and the file mustn't depend on the mode it was annotated in: what's saved is always the
:rootvalue, which the viewer reads from your stylesheet, even in dark mode. The.darkvalues are only shown: highlights on dark pages (reading colours in dark mode), through pdf.js's on-screen variants of its colours, which it maps back to the saved ones when it saves. On the document's white pages, and for text and drawings, the saved colours show — as they print.
Annotations and comments
pdf.js's editors draw highlights, text, drawings, images and signatures; your tools set the editor mode and its settings. The toolbar on a selected annotation is yours — a template the viewer stamps where pdf.js puts its own, so it follows the annotation — with your colours, comment, alt-text and delete buttons, your icons and words. A comment belongs to an annotation, as in pdf.js: your toolbar's comment button asks for one, and your comment form writes it. Deleting offers your undo bar. Signatures are made in your dialog — typed, drawn or from an image — and saved for reuse in savedSignatures.
Saving and page organisation
Download and Print write the annotations, comments and form data into the PDF, the pages in their order. In the full example's Pages sidebar, select pages to move, copy, cut, paste, delete or save them as a new file, drag them to reorder, or insert another PDF — as pdf.js does, without rebuilding the file; every change can be undone.
Keyboard
pdf.js's shortcuts, while focus is in the viewer (keyboardShortcuts turns them off):
- Ctrl + F find, Ctrl + G next match; Ctrl + = / Ctrl + − / Ctrl + 0 zoom; Ctrl + wheel or a pinch zooms around the pointer.
- N / J next page, P / K previous, Home / End first and last; Ctrl + Alt + G the page field.
- R / Shift + R rotate; S / H select or hand tool; F4 the sidebar.
- Ctrl + O open, Ctrl + S download, Ctrl + P print, Ctrl + Alt + P presentation mode.
Accessibility
- Parts add roles and states (toolbar, group, status, alert, separator, pressed, current, expanded); you give the names — icon buttons, toolbars, groups, the page field.
- Tagged PDFs expose their structure — headings, lists, tables, figures with alt text — to screen readers; form fields are named from the document; images placed on a page take alt text.
- Pages are landmarks only when you name them:
pageNameon the canvas, e.g.(page, label) => 'Report, page ' + label. pdf.js's viewer makes every page a region named "Page N"; with two viewers on a page (as here), or labels that repeat page numbers, those names repeat — screen readers can't tell the landmarks apart — and a long document floods the list of landmarks. - In the system's high-contrast mode the pages are drawn in its colours; with
enablePermissions, a document that forbids copying, printing or annotating is shown that way.
Examples
The complete viewer: sidebar (pages, outline, attachments, layers, comments), find, annotation tools, signatures, view options and the keyboard shortcuts. Drop a PDF on it to open it.
PDF Viewer
import { DecimalPipe, NgTemplateOutlet } from '@angular/common';import { Component, ViewEncapsulation, computed, input, signal,} from '@angular/core';import { ScBadge,Form fields are real inputs; the document's own scripts run in pdf.js's sandbox — here the total is computed by the PDF. Download and Print include what you typed in.
Order form with a script
import { Component, ViewEncapsulation, computed, input } from '@angular/core';import { ScDialog, ScDialogClose, ScDialogDescription, ScDialogFooter, ScDialogHeader, ScDialogPortal, ScDialogProvider, ScDialogTitle, pdf.js's open parameters in the fragment of src (page, zoom, nameddest, search, pagemode) are applied on load, or later with applyHash. This document has page labels: the page field shows them.
Open parameters and page labels
import { Component, ViewEncapsulation, computed, input } from '@angular/core';import { ScButton, ScInput, ScSpinner } from '@semantic-components/ui';import { ScPdfViewer, ScPdfViewerCanvas, ScPdfViewerContainer, ScPdfViewerContent, ScPdfViewerFindResultsInfo, ScPdfViewerLoading, ScPdfViewerPageInput,Presentation mode: one page at a time, fitted to the screen, in fullscreen. A click, the arrow keys, the wheel or a swipe turn the page; Escape leaves and restores the view.
Present the handbook
import { Component, ViewEncapsulation, computed, input } from '@angular/core';import { ScButton, ScFieldTitle, ScInput, ScPopover, ScPopoverPortal, ScPopoverProvider, ScPopoverTrigger, ScSpinner, Reading: jumps are remembered — Back and Forward return to where you were, in the viewer rather than the browser's history — and a document reopens where it was left (rememberView). pageColors draws the pages in the theme's page colours (a reading mode: --sc-pdf-viewer-page-foreground on --sc-pdf-viewer-page, light and dark values as every theme colour — the pages follow the app's mode). With the browser's caret browsing (F7) on, tell the viewer (caretBrowsing) and ↑ / ↓ move the caret line by line through the text.
Read the handbook
import { Component, ViewEncapsulation, computed, input } from '@angular/core';import { ScField, ScFieldDescription, ScInput, ScLabel, ScSpinner, ScSwitch, ScTooltip, ScTooltipArrow,RTL
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation, computed, input,} from '@angular/core';import { ScEmpty,API reference
Each part takes class, merged over its look (cn: a later class wins). Button parts style their button — the style's — with variant and size as on scButton; write their icon and text, and name the icon-only ones.
| Input | Type | Default | Description |
|---|---|---|---|
src | string | '' | The PDF's URL — its fragment, pdf.js's open parameters (#page=3, #nameddest=…). |
fileName | string | '' | The download and print name, without .pdf. |
initialPage | number | 1 | The page it opens at, without open parameters or a remembered view. |
initialZoom | ScPdfZoomLevel | 'auto' | A scale (1.5) or 'auto', 'page-actual', 'page-fit', 'page-width'. |
assetsUrl | string | '/pdfjs/' | Where pdf.js's worker, sandbox, fonts, CMaps, wasm decoders and images are (pdfjs-dist's folders). |
workerSrc, sandboxSrc, wasmSrc | string | '' | Their URLs, if not under assetsUrl. |
enableScripting | boolean | true | The document's scripts (calculations, validation, actions) in pdf.js's sandbox. |
enableAutoLinking | boolean | true | URLs and email addresses in the text become links. |
enablePermissions | boolean | false | Follow the document's permissions: no copying, printing, annotating or form filling when it forbids them. |
rememberView | boolean | true | A document reopens where it was left: page, zoom, scroll, rotation. |
keyboardShortcuts | boolean | true | pdf.js's shortcuts, while focus is in the viewer. |
autoPrint | boolean | true | Print when the document asks to on opening. |
[(sidebarOpen)], [(sidebarView)] | boolean, ScPdfSidebarView | false, 'thumbnails' | The sidebar, and its view. |
[(cursorTool)], [(scrollMode)], [(spreadMode)] | string | 'select', 'vertical', 'none' | The view: select or hand tool, scroll and spread modes. |
[(pageColors)] | boolean | false | The pages in the theme's page colours: --sc-pdf-viewer-page-foreground on --sc-pdf-viewer-page, following the app's mode. Off: the document's own. |
[(caretBrowsing)] | boolean | false | The browser's caret browsing (F7) is on: ↑ / ↓ move the caret line by line. |
[(savedSignatures)] | ScPdfSignatureData[] | [] | Signatures saved for reuse — bind to keep them between sessions. |
class | string | '' | Classes merged over its own. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewer | [scPdfViewer] | The document and all state (exportAs scPdfViewer): currentPage(), totalPages(), pageLabel(n), zoom(), findState(), comments(), undoable(), editorMode(), toolSettings()… and its methods. Outputs: loaded, pageChange, zoomChange, errorEvent, fileOpened. |
ScPdfViewerContainer | [scPdfViewerContainer] | The frame — the style's, as scFrame's; the fullscreen element. |
ScPdfViewerToolbar | [scPdfViewerToolbar] | A toolbar row (role toolbar): name it. Hidden in presentation mode. |
ScPdfViewerNav, ScPdfViewerZoom | [scPdfViewerNav], [scPdfViewerZoom] | Groups of page or zoom controls (role group): name them. |
ScPdfViewerSpacer | [scPdfViewerSpacer] | Pushes what follows to the end of the row. |
ScPdfViewerContent | [scPdfViewerContent] | The page area. Opens a file dropped on it (data-dragging; [dropFiles]="false" turns it off). |
ScPdfViewerCanvas | div[scPdfViewerCanvas] | pdf.js's viewer: the pages. pageName: a function naming each page, which makes them landmarks. |
ScPdfViewerMenu | [scMenu][scPdfViewerMenu] | Runs commands: each item's value — open, download, print, presentation, fullscreen, first-page, last-page, rotate-right, rotate-left, properties. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerPrevPage, ScPdfViewerNextPage | button[scPdfViewerPrevPage], button[scPdfViewerNextPage] | The previous / next page (spread); disabled at the ends. |
ScPdfViewerBack, ScPdfViewerForward | button[scPdfViewerBack], button[scPdfViewerForward] | Back to before the last jump, or forward again. |
ScPdfViewerZoomIn, ScPdfViewerZoomOut | button[scPdfViewerZoomIn], button[scPdfViewerZoomOut] | Zoom a step, as pdf.js (10% to 2500%). |
ScPdfViewerRotateLeft, ScPdfViewerRotateRight | button[scPdfViewerRotateLeft], button[scPdfViewerRotateRight] | Rotate the pages a quarter turn. |
ScPdfViewerSidebarToggle | button[scPdfViewerSidebarToggle] | Opens and closes the sidebar (aria-pressed). |
ScPdfViewerFindToggle | button[scPdfViewerFindToggle] | Opens and closes the find bar (aria-pressed). |
ScPdfViewerFullscreen, ScPdfViewerPresentation | button[scPdfViewerFullscreen], button[scPdfViewerPresentation] | Fullscreen; presentation mode (aria-pressed). |
ScPdfViewerOpenFile | button[scPdfViewerOpenFile] | Asks for a PDF and opens it. |
ScPdfViewerDownload, ScPdfViewerPrint | button[scPdfViewerDownload], button[scPdfViewerPrint] | Download or print, with annotations, comments and form data; print is disabled if the document forbids it. |
ScPdfViewerRetry | button[scPdfViewerRetry] | Loads again after an error. |
ScPdfViewerUndo, ScPdfViewerUndoDismiss | button[scPdfViewerUndo], button[scPdfViewerUndoDismiss] | Undo, or close, what the undo bar offers. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerPageInput | input[scInput][scPdfViewerPageInput] | The current page — its label when the document has labels; takes a label or a number. |
ScPdfViewerZoomSelect | select[scPdfViewerZoomSelect] | Binds the zoom (exportAs scPdfViewerZoomSelect): write the options — auto, page-actual, page-fit, page-width, zoom.scales(). |
ScPdfViewerFindbar | [scPdfViewerFindbar] | The find bar's row, under the toolbar. |
ScPdfViewerFindInput | input[scPdfViewerFindInput] | Finds as you type; Enter / Shift + Enter: next / previous. |
ScPdfViewerFindPrevious, ScPdfViewerFindNext | button[scPdfViewerFindPrevious], button[scPdfViewerFindNext] | The previous / next match. |
ScPdfViewerFindResultsInfo | [scPdfViewerFindResultsInfo] | Where results are announced (role status, data-state): write them from the viewer. |
ScPdfViewerSetting | [scToggleGroup], [scTabs], input[scSlider], input[scSwitch], input[scCheckbox] [scPdfViewerSetting] | Binds a setting both ways: editorMode, sidebarView, cursorTool, scrollMode, spreadMode, pageColors, the tools’ thickness, size and opacity, highlightShowAll, the find options, caretBrowsing. |
ScPdfViewerColor | button[scPdfViewerColor] | A colour swatch (the theme’s variable) for setting: highlightColor, freetextColor or inkColor; pressed while it’s the one. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerLoading | [scPdfViewerLoading] | Covers the pages while loading (role status). |
ScPdfViewerLoadingBar | [scProgress][scPdfViewerLoadingBar] | The download progress. |
ScPdfViewerError | [scPdfViewerError] | Shown when loading fails (role alert, data-kind): word it from viewer.error(). |
ScPdfViewerEmpty | [scPdfViewerEmpty] | Shown while there’s no document. |
ScPdfViewerUndoBar | [scPdfViewerUndoBar] | The undo bar (role status, data-state): write its content while viewer.undoable() is set. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerDialog | [scDialogProvider][scPdfViewerDialog] | Opens your dialog when the viewer needs it, and tells it when it's closed: password, print, altText, signature, properties. |
ScPdfViewerPasswordForm, ScPdfViewerPasswordInput | form[scPdfViewerPasswordForm], input[scPdfViewerPasswordInput] | The password dialog’s form (incorrect()) and field. |
ScPdfViewerPrintProgress | [scProgress][scPdfViewerPrintProgress] | The print dialog’s progress. |
ScPdfViewerAltTextForm, ScPdfViewerAltTextInput, ScPdfViewerAltTextKind | form[scPdfViewerAltTextForm], textarea[scPdfViewerAltTextInput], input[type=radio][scPdfViewerAltTextKind] | An image's alt text — a description, or decorative — opened by pdf.js's alt text button. |
ScPdfViewerSignatureForm | [scPdfViewerSignatureForm] | Makes a signature: typed, drawn or from an image (exportAs scPdfViewerSignatureForm). |
ScPdfViewerSignatureMode | [scTabs][scPdfViewerSignatureMode] | Tabs for how it’s made: type, draw, image. |
ScPdfViewerSignatureName, ScPdfViewerSignaturePad, ScPdfViewerSignatureImage | input[scInput][scPdfViewerSignatureName], canvas[scPdfViewerSignaturePad], button[scPdfViewerSignatureImage] | The typed name, the drawing pad, the image button. |
ScPdfViewerSignatureDescription, ScPdfViewerSignatureClear, ScPdfViewerSignatureAdd | input[scPdfViewerSignatureDescription], button[scPdfViewerSignatureClear], button[scPdfViewerSignatureAdd] | Its description; clear; add it (and save it for reuse). |
ScPdfViewerSignaturePlace, ScPdfViewerSignatureRemove, ScPdfViewerSignatureNew | button[scPdfViewerSignaturePlace], button[scPdfViewerSignatureRemove], button[scPdfViewerSignatureNew] | In your list of saved signatures: place one, remove one, make a new one. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerAnnotationToolbar | ng-template[scPdfViewerAnnotationToolbar] | Your toolbar on a selected annotation (let-annotation: { id, type, pageNumber }), stamped where pdf.js puts its own; the style's popover. |
ScPdfViewerIcon | ng-template[scPdfViewerIcon] | Your icon in pdf.js's places on the pages: comment (the button by an annotation), alt-text-missing, media-play, page-loading. |
ScPdfViewerAnnotationComment, ScPdfViewerAnnotationAltText, ScPdfViewerAnnotationDelete | button[scPdfViewerAnnotationComment], button[scPdfViewerAnnotationAltText], button[scPdfViewerAnnotationDelete] | In it: writes the annotation's comment; an image's alt text (data-done once it has one); removes it (undoable). |
ScPdfViewerAddImage | button[scPdfViewerAddImage] | Asks for an image and places it (pdf.js's image editor). |
ScPdfViewerComment | [scPdfViewerComment] | A comment in your list of viewer.comments() (data-active when picked). |
ScPdfViewerCommentShow, ScPdfViewerCommentEdit, ScPdfViewerCommentRemove | button[scPdfViewerCommentShow], button[scPdfViewerCommentEdit], button[scPdfViewerCommentRemove] | Shows its annotation; edits it; deletes it (undoable). |
ScPdfViewerCommentForm, ScPdfViewerCommentInput, ScPdfViewerCommentCancel | form[scPdfViewerCommentForm], textarea[scPdfViewerCommentInput], button[scPdfViewerCommentCancel] | Writes the comment asked for (viewer.pendingComment()). |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerSidebarResizer | [scPdfViewerSidebarResizer] | Resizes the sidebar (drag, ← / →): a separator — name it. |
ScPdfViewerThumbnail | img[scPdfViewerThumbnail] | A page's thumbnail, drawn when near view. |
ScPdfViewerGoToPage | button[scPdfViewerGoToPage] | Goes to its page (aria-current). |
ScPdfViewerOutlineItem, ScPdfViewerOutlineToggle | button[scPdfViewerOutlineItem], button[scPdfViewerOutlineToggle] | A bookmark (aria-current), and its toggle (aria-expanded). |
ScPdfViewerOutlineExpandAll, ScPdfViewerOutlineCollapseAll, ScPdfViewerOutlineFindCurrent | button[scPdfViewerOutlineExpandAll], button[scPdfViewerOutlineCollapseAll], button[scPdfViewerOutlineFindCurrent] | Open or close all; reveal the current bookmark. |
ScPdfViewerAttachment | button[scPdfViewerAttachment] | Downloads an attached file. |
ScPdfViewerLayer | input[scCheckbox][scPdfViewerLayer] | Shows or hides a layer. |
| Part | Selector | Description |
|---|---|---|
ScPdfViewerPages | [scPdfViewerPages] | Your list of viewer.pageNumbers(): drag to reorder; Delete, Ctrl + C / X / V on the selection. |
ScPdfViewerPageItem, ScPdfViewerPageSelect | [scPdfViewerPageItem], input[scCheckbox][scPdfViewerPageSelect] | A page in it (draggable, data-selected, data-current), and its checkbox. |
ScPdfViewerMovePagesEarlier, ScPdfViewerMovePagesLater | button[scPdfViewerMovePagesEarlier], button[scPdfViewerMovePagesLater] | Move the selected pages a place. |
ScPdfViewerCopyPages, ScPdfViewerCutPages, ScPdfViewerPastePages, ScPdfViewerDeletePages | button[scPdfViewerCopyPages], button[scPdfViewerCutPages], button[scPdfViewerPastePages], button[scPdfViewerDeletePages] | Copy, cut, paste (after the current page), delete — undoable. |
ScPdfViewerExportPages, ScPdfViewerInsertPages | button[scPdfViewerExportPages], button[scPdfViewerInsertPages] | Download the selected pages; insert another PDF (viewer.insertFailed() names one that isn’t). |