Interactive Demo
Try out the PDF converter library below. Upload PDF, EPS, or SVG files to see it in action.
Features
- Convert EPS files to PDF with advanced page sizing and cropping
- Convert SVG files to PDF with multiple backends (RESVG, jsPDF, svg2pdf.js)
- Compare all SVG engines side-by-side with "All Engines" option
- Compress existing PDF files with customizable quality settings
- Batch processing of multiple files with ZIP download
- Advanced color conversion strategies (sRGB, CMYK, Grayscale)
- Image downscaling and optimization with custom resolution
- Web optimization for faster loading
- Metadata removal for privacy
- Multiple PDF compatibility levels
- Custom page sizes and dimensions
- Preview PDF results before downloading
- Re-convert with different options without re-uploading
- Client-side processing - files never leave your browser
Installation
npm install vector-pdf-converter
Usage
import { PDFConverter } from 'vector-pdf-converter';
// Convert a PDF file
const result = await PDFConverter.convertFile(file, {
quality: 'ebook',
downscaleImages: true,
optimizeForWeb: true,
colorConversionStrategy: 'sRGB',
compatibilityLevel: '1.4'
});
// Convert an SVG file
const svgResult = await PDFConverter.convertSVG(svgFile, {
backend: 'resvg',
scale: 1,
backgroundColor: 'white',
preserveAspectRatio: true
});
// Convert SVG with all engines for comparison
const allResults = await PDFConverter.convertSVG(svgFile, {
backend: 'all',
scale: 1,
backgroundColor: 'white'
});
// Convert an EPS file
const epsResult = await PDFConverter.convertFile(epsFile, {
cropToEPS: true,
fitToPage: true,
pageSize: 'a4',
resolution: 300
});
// Batch convert multiple files
const batchResults = await Promise.all(
files.map(file => PDFConverter.convertFile(file, options))
);
// Download the result
const link = document.createElement('a');
link.href = result.url;
link.download = 'converted.pdf';
link.click();