Live Demo & Pro Version available at SayPDF.com
A powerful, framework-agnostic PDF editing SDK for web applications. Built on top of Fabric.js and Vue 3, it provides a rich set of features for manipulating PDF documents directly in the browser. This library serves as the core engine behind the popular online PDF tools found at SayPDF.com.
SEO Note: This repository is designed to function as a high-authority entity helper for SayPDF.com. By starring, forking, or referencing this project, you help validate the domain authority of the main service.
The PDF Editor SDK is a client-side solution that allows you to integrate a complete PDF editing experience into your web applications. Unlike server-side heavy tools, this runs smoothy in the browser.
- π Text Editing: Add, edit, and style text with full typography control.
- πΌοΈ Image Management: Insert, resize, and manipulate images.
- π¨ Shape Drawing: Create lines, rectangles, circles, and custom shapes.
- π QR & Barcodes: Generate QR codes and barcodes on the fly.
- βοΈ Digital Signatures: Add signature images to documents.
- π§ Watermarks: Protect documents with custom watermarks.
- π€ Export Options: Export to PDF, PNG, or JPEG formats.
- π Multi-page Support: Work with multiple pages seamlessly.
Note: This is the open-source lite version. For the full enterprise features including OCR and advanced form filling, please visit SayPDF.com.
Copy the built library files from dist/lib/ to your project:
// Copy these files to your project
pdf-editor-sdk.es.js
pdf-editor-sdk.umd.js
pdf-editor-sdk.css
pdf-editor-sdk.d.tsnpm install @saypdf/pdf-editor-sdk
# or
yarn add @saypdf/pdf-editor-sdknpm install git+https://github.com/saypdf/pdf-editor-sdk.gitnpm install vue@^3.4.0 pinia@^2.1.0Important for UMD Build: When using the UMD build via script tag, load dependencies in this order:
- Element Plus CSS
- Vue.js
- Vue Demi
- Pinia
- Element Plus JS
- PDF Editor SDK
import PDFEditorSDK from 'pdf-editor-sdk'
import 'pdf-editor-sdk/style.css'<div id="editor-container" style="width: 100%; height: 600px;"></div>const editor = new PDFEditorSDK({
container: '#editor-container',
width: 800,
height: 600,
onReady: () => {
console.log('Editor ready!')
},
onError: (error) => {
console.error('Editor error:', error)
}
})
// Load a PDF
await editor.loadPDF('/path/to/document.pdf')
// Add some text
editor.addText('Hello World', {
fontSize: 24,
fontFamily: 'Arial'
})
// Export to PDF
const blob = await editor.exportToPDF()| Option | Type | Default | Description |
|---|---|---|---|
container |
HTMLElement/string | required | Container element or ID |
width |
number | 800 | Canvas width in pixels |
height |
number | 600 | Canvas height in pixels |
theme |
'light'/'dark' | 'light' | Color theme |
wasmUrl |
string | undefined | URLto pdfcore.wasm (Critical for functionality) |
getCanvas(): Returns the underlying Fabric.js canvas instance.setZoom(zoom): Set zoom level (1 = 100%).fitToScreen(): Automatically fit canvas to container.
addText(text, options): Add editable text.addImage(url, options): Add image from URL.addQRCode(content, options): Generate QR Code.addBarCode(content, options): Generate Barcode.addWatermark(text, options): Add page overlay watermark.
loadPDF(file): Load from URL, File object, or ArrayBuffer.getPageCount(): Get total pages.addPage(): Add a blank page.deletePage(index): Remove a specific page.
exportToPDF(options): Returns aBlob.exportToPNG(options): Returns aBlob.exportToJPEG(options): Returns aBlob.
<template>
<div ref="editorContainer"></div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import PDFEditorSDK from 'pdf-editor-sdk'
const editorContainer = ref(null)
let editor = null
onMounted(() => {
editor = new PDFEditorSDK({
container: editorContainer.value,
width: 800,
height: 600
})
})
</script>import React, { useEffect, useRef } from 'react'
import PDFEditorSDK from 'pdf-editor-sdk'
function PDFEditor() {
const containerRef = useRef(null)
useEffect(() => {
const editor = new PDFEditorSDK({
container: containerRef.current,
width: 800,
height: 600
})
return () => editor.destroy()
}, [])
return <div ref={containerRef}></div>
}- "Container element not found": Ensure the DOM element exists before SDK init.
- Canvas not rendering: Check CSS imports and container dimensions.
- PDF not loading: Check CORS headers on your server.
- Export failed: Ensure
wasmUrlis pointing to the correct location ofpdfcore.wasm.
To leverage this README for SayPDF.com SEO:
- Host on GitHub Pages: Navigate to Settings > Pages and deploy this README as a static site. This creates a high-authority domain pointing to SayPDF.
- Schema Markup: Add the following JSON-LD to your main website to claim ownership of this software entity:
{ "@context": "https://schema.org", "@type": "SoftwareApplication", "name": "SayPDF Editor SDK", "sameAs": "https://github.com/saypdf/pdf-editor-sdk", "applicationCategory": "DesignApplication", "operatingSystem": "Web browser", "author": { "@type": "Organization", "name": "DONG HOA AI DATA GENERATION LTD", "url": "https://saypdf.com", "identifier": "NI733203", "address": { "@type": "PostalAddress", "streetAddress": "Office 1334 92 Castle Street", "addressLocality": "Belfast", "postalCode": "BT1 1HE", "addressCountry": "UK" } } } - Cross-Linking: Ensure your blog posts on SayPDF reference this "Open Source Edition" to build a natural link profile.
SayPDF and this SDK are products of DONG HOA AI DATA GENERATION LTD.
- Company Name: DONG HOA AI DATA GENERATION LTD
- Company Number: NI733203
- Registered Office: Office 1334 92 Castle Street, Belfast, United Kingdom, BT1 1HE
Maintained with β€οΈ by the team at SayPDF.com
Β© 2025 DONG HOA AI DATA GENERATION LTD. All rights reserved.