Editing PDFs
Choose the PDF Facade workflow for pages, text, tables, images, dividers, annotations, and native text.
PDF editing APIs run through Univer commands and participate in undo and redo when an inverse operation is available. Start with the topic that matches the content you need to change.
Editing topics
- Pages and Elements: insert pages, enumerate editable overlays, transform, stack, lock, and remove elements.
- Text and Lists: edit text boxes, paragraph blocks, and semantic lists.
- Tables: insert and resize grids, update cells, and apply themes.
- Images and Dividers: insert managed images and vector dividers.
- Annotations and Native Text: add supported annotations and promote imported text.
Combine operations
TypeScript
const pdf = univerAPI.getActivePdf()const page = pdf?.getPageByIndex(0)if (!page) { throw new Error('No active PDF page')}const image = await page.insertImageAsync( 'https://example.com/assets/signature.png', { left: 36, top: 36, width: 144, height: 72 })image.setRotation(-4).bringToFront()Facade placement values use PDF points. Use absolute http or https URLs for URL-backed images; relative URL paths are not accepted by automatic source detection.
For unit creation, lookup, saving, and the complete wrapper overview, see the Univer PDFs API.
How is this guide?