Docs / Editors / PDF Editor
PDF Editor
Svelte 5 port of the Extend UI pdf-editor (document-level edits: rotate, delete, reorder, download). Rendering runs on the client with PDF.js; downloads run on pdf-lib.
Fixture document
Dark mode is controlled by the parent through isDark and onIsDarkChange; this switch lives on the page, outside the editor.
Loading PDF…
Edited pages: none yet
Differences from upstream
- Document-level edits only (rotate, delete, reorder, reset, download). Not ported yet: annotate, sign, forms, redact, search, print, password prompts, undo/redo, and the imperative handle.
- Keyboard shortcuts while the editor has focus: ⌘/Ctrl S download, ⌘/Ctrl = and ⌘/Ctrl - zoom, ⌘/Ctrl 0 fit page. Upstream's undo/redo, print, search, and Escape/Delete annotation shortcuts are not ported.
- A page list beside a single-page preview replaces the upstream scrolling workspace and side panels. The list follows upstream's thumbnail listbox (focus the list, then ArrowUp/ArrowDown/Home/End); page actions (rotate, move, delete) sit in a toolbar above it, like upstream's pages panel.
- Page actions apply to the one selected page. Not ported yet from upstream's pages panel: multi-page selection (Shift/⌘-click), insert blank page, append PDF, and extract pages.
- Delete asks for confirmation in the editor and never removes the last page, like upstream; the notice shows inline instead of as a toast.
- Renders with PDF.js through the shared engine and downloads with pdf-lib instead of EmbedPDF; zoom modes use EmbedPDF's formulas.
- Dark mode is parent-controlled with
isDarkandonIsDarkChange; the editor renders no dark toggle. classandclassNameare both accepted.- Extra props:
onPagesChange,height,pageWidth/pageHeight(fallback page size). - Not accepted yet:
defaultMode,annotationAuthor,colorPresets,features,toolbarActions,selectionActions,persistSignatures,stampManifests,signatureFontsStylesheetUrl,resolveScrollAreaViewport,renderPageOverlay, and the mode, annotation, form, redaction, capture, toast, and selection callbacks. - Port-only exports:
PdfEditor(the same component asPDFEditor) and the page-model helperscreateEditState,deleteEditPage,exportEditedPdf,getPdfFileName,moveEditPage,resetEditState,rotateEditPage. Port-only types:PdfEditorProps,PdfEditorDocumentInfo,PdfEditorSaveResult,PdfEditorZoomLevel,EditedPdfPage,PdfEditState,PdfRotateDirection(upstream'sPDFEditorPropsandPDFEditorZoomLevelare exported too). Not exported: upstream'sserializeAnnotationItems,deserializeAnnotationItems,PDFEditorHandle,PDFEditorToastandPDFEditorPageOverlayProps, which belong to features not ported.