Polotno Docs
Export & Import

Import and Export

Overview of Polotno's import (JSON) and export (PNG, JPEG, PDF, PPTX, HTML, SVG, GIF, MP4) options

Polotno offers comprehensive import and export capabilities for designs, from open JSON format to high-quality images, PDFs, and video exports. The SDK supports both client-side and server-side rendering for automated design generation.

Import: JSON (open, developer-friendly format)

Export: JSON, PNG, JPEG, PDF, PPTX, GIF, MP4, HTML, SVG

Key use cases: Template systems, programmatic generation, print production, digital graphics, animations, web embedding.

JSON Import and Export

Polotno uses an open JSON format designed for developer flexibility. You can export, read, modify, and re-import designs programmatically.

Key features:

  • Simple, readable format — JSON structure is straightforward and documented
  • Fully modifiable — export, modify properties, and re-import
  • Programmatic generation — create or modify designs in code
  • Template system — save and load templates, generate variations dynamically

Export to JSON

const json = store.toJSON();
console.log(json); // readable JSON structure

// modify programmatically
json.pages[0].children[0].text = 'Updated text';

// save or send to backend
localStorage.setItem('design', JSON.stringify(json));

Import from JSON

// load previously saved design
const json = JSON.parse(localStorage.getItem('design'));
store.loadJSON(json);

// import template or generated design
store.loadJSON({
  width: 800,
  height: 600,
  pages: [/* ... */]
});

The JSON must follow Polotno's store structure. See JSON Schema for complete reference.

Note: Polotno doesn't import other formats (PDF, PPT, PSD) directly, but you can build converters to transform them into Polotno JSON. Contact us to collaborate.

Image Export (PNG, JPEG)

Export designs as PNG or JPEG images. Available client-side and server-side.

// basic export
await store.saveAsImage();

// with quality control
await store.saveAsImage({ 
  pixelRatio: 2,
  mimeType: 'image/png'
});

// as data URL or blob
const dataURL = await store.toDataURL();
const blob = await store.toBlob();

PDF Export

Export designs as PDF files. Client-side exports contain raster images (flattened per page), but produce high quality suitable for print. For vector PDFs, use the Cloud Render API.

// basic export
await store.saveAsPDF();

// with bleed and crop marks
await store.saveAsPDF({ 
  includeBleed: true, 
  cropMarkSize: 20,
  pixelRatio: 2 
});

See PDF Export for details on bleed, crop marks, and quality settings.

GIF Export

Export animated designs as GIF files. Available client-side and server-side.

await store.saveAsGIF();

// with custom settings
await store.saveAsGIF({
  fps: 30,
  pixelRatio: 2
});

Video Export (MP4)

Export animated designs as MP4 video files.

Client-side: Use @polotno/video-export package for browser-based video encoding. See Video Export for details.

Server-side: Use Cloud Render API.

HTML and SVG Export

Export designs as HTML or SVG for embedding in websites or further processing.

// export as HTML
const html = await store.toHTML();
await store.saveAsHTML();

// export as SVG
const svg = await store.toSVG();
await store.saveAsSVG();

Note: May not support all elements or features. For pixel-perfect exports, use PNG/JPEG or PDF.

PPTX Export (PowerPoint)

Export designs as PowerPoint presentations. Multi-page designs become multi-slide presentations.

await store.saveAsPPTX();

See PPTX Export for details.

Server-Side Rendering

All export formats can be generated server-side for high-volume or automated workflows.

Options:

  1. Node.js with Polotno SDK — run Polotno in Node.js environment. See Server-Side Image Generation.
  2. Cloud Render API — fully managed rendering service, no infrastructure needed. See Cloud Render API.

Complete API Reference

For all export options and parameters, see Store API.