Polotno Docs
Export & Import

PDF Import

Convert PDF files into editable Polotno designs

The @polotno/pdf-import package converts PDF files into Polotno JSON format, enabling you to import PDF designs into Polotno for further editing.

Beta Feature: This library is new and may not work correctly for all PDF files. Please report issues to help us improve it.

Installation

npm install @polotno/pdf-import

Basic Usage

import { pdfToJson } from '@polotno/pdf-import';

const json = await pdfToJson({ pdf: buffer });

// Load into Polotno store
store.loadJSON(json);

Node.js Example

import { pdfToJson } from '@polotno/pdf-import';
import fs from 'fs';

const buffer = fs.readFileSync('design.pdf');
const json = await pdfToJson({ pdf: buffer });
store.loadJSON(json);

Browser Example

import { pdfToJson } from '@polotno/pdf-import';

async function handleFileUpload(file: File) {
  const buffer = await file.arrayBuffer();
  const json = await pdfToJson({ pdf: buffer });
  store.loadJSON(json);
}

Adobe Illustrator (.ai) Support

Adobe Illustrator .ai files are based on the PDF format, so you can import them using the same pdfToJson() function.

Platform Support

This package works both client-side (browser) and server-side (Node.js). All processing runs locally — no data is sent to any external server.

Demo

Troubleshooting

Import produces unexpected results:

  • Check if the PDF contains vector elements or rasterized content
  • Try re-exporting the PDF from your design tool with different settings

Missing elements:

  • Some advanced PDF features may not be supported
  • Check browser console for warnings

Need help? Report issues and get support at community.polotno.com.

On this page