Polotno SDK accepts designs from a range of common formats — JSON, Figma frames, SVG, PDF, and Photoshop files. Imports preserve layer structure so vector shapes stay vector, text stays editable, and images stay images. Every imported design becomes a Polotno JSON document — schema-validated, programmatically modifiable, and ready to render in any export format the SDK supports. Import runs client-side or server-side, with the same schema and the same result.
Key features
JSON import (native format)
Polotno's native format is open JSON. Export, modify, and re-import designs programmatically. Use it to save user work, generate designs from code or templates, validate AI-generated output against the published JSON Schema, or version-control designs in Git. See JSON import and export.
Figma import (via SVG)
Bring designs from Figma into Polotno by exporting frames as SVG and running them through @polotno/svg-import. Vector shapes stay vector, text stays editable when not outlined, images stay images, and the layer hierarchy is preserved. See Figma import.
SVG import
Import SVG files (from any tool) using @polotno/svg-import. Layers become editable Polotno elements. Works client-side and server-side. Try it in the browser with the SVG to JSON tool or read the SVG import docs.
PDF import
Import PDF files using @polotno/pdf-import. Layouts come through with embedded fonts, vector paths, and images preserved. Available in browser and Node. Try it with the PDF to JSON tool or read the PDF import docs.
PSD import
Import Photoshop .psd files using @polotno/psd-import. Text, vector shapes, and raster layers come through as separate, editable elements. Masks and unsupported effects are flattened per layer so the rest of the document remains separable. Try it with the PSD to JSON tool or see the PSD import docs.
Image upload (built-in panel)
The default Upload panel in the editor lets end users drag in images directly. Files are converted to base64 and stay in the browser — nothing is uploaded to Polotno. Replace this panel with your own storage, scanning, or access controls if needed.
Schema-validated
Every import produces JSON that conforms to Polotno's published JSON Schema. You can validate generated or transformed JSON before rendering, catching bad inputs at the boundary rather than at render time.
Server-side import
All importers (@polotno/svg-import, @polotno/pdf-import, @polotno/psd-import) run in Node.js with the same API. Bring user-submitted files into a Polotno design on the backend, transform them programmatically, and render them via the Cloud Render API or self-hosted rendering.
Example use cases
- Migrating from Figma or PSD-based workflows — Bring brand templates and design assets into a programmable, embeddable editor.
- User-uploaded design ingestion — Let end users bring their own SVG, PDF, or PSD files and edit them in your app.
- AI-generated design pipelines — Validate LLM-generated JSON against the schema, then load it into the store for further editing or rendering.
- Template marketplaces — Ingest designs from third-party libraries or partner systems and serve them as editable templates.
- Backend batch processing — Convert PDFs or SVGs into Polotno JSON on the server for transformation and re-rendering.
- PDF document editing — Import existing PDFs as editable canvases for layout adjustments before re-export.
Developer benefits
- One schema across all import formats.
- Works in browser and Node.js with identical APIs.
- Schema-validated output — bad inputs caught at the boundary.
- Editable layers preserved (where the source format supports them).
- Open JSON output — your data stays portable.
FAQs
Which import formats are supported?
JSON (native), Figma (via SVG export), SVG, PDF, and PSD. All produce Polotno JSON, validated against the public JSON Schema.
Can I import a .fig file directly?
Not natively. Use Figma's SVG export as a bridge — the result is editable Polotno layers in most cases. See Figma import.
Can imports run server-side?
Yes. @polotno/svg-import, @polotno/pdf-import, and @polotno/psd-import all work in Node.js. Use them in backend pipelines, batch jobs, or on-demand conversion endpoints.
Does text stay editable on import?
Yes for SVG, PSD, and Figma — provided text isn't converted to paths in the source file (Figma's "Outline text" option is the common culprit). PDF preserves text where the PDF embeds it as searchable text.
Can I validate imported JSON before rendering?
Yes. The JSON Schema is published and works with any standard JSON Schema validator (Ajv, JSON Schema CLI, etc.). Validate, then render.
What happens to images embedded in imported files?
They're extracted and become Polotno image elements with their own URLs or data URIs, depending on the source format.
