@getv.design/export
Export vDesign designs (.vd files) as PNG, JPEG, WebP, SVG, PDF, Adobe Illustrator, HTML,
PowerPoint and GIF, in Node, with no browser. The export is exactly what the vDesign canvas
draws: the same layout, the same fonts, the same line breaks.
npm install @getv.design/export
Node 22 or later. Everything it needs is inside the package: the renderers are WebAssembly, and the Inter faces the designs default to are included. Other fonts come from the machine, from the design itself, or from a folder you name: see Fonts.
From the command line
npx vdesign-export deck.vd --format pptx # deck.pptx beside it
npx vdesign-export deck.vd -f png --scale 2 -o shots # a PNG per frame
npx vdesign-export deck.vd -f pdf --frames cover,pricing # two pages
npx vdesign-export deck.vd -f svg --text outline --json # the files and a report, as JSON
The design is a .vd, or a .vd.svg that carries one. Pictures come from the file itself,
and a font the design names by path is read from beside it. The files made are printed to
stdout and anything not drawn as the design asked (a missing font, a missing picture) to
stderr. Exit code 0 means done, 1 that the export cannot be made, 2 a bad request.
vdesign-export --help lists every option.
From code
import { exportFile, exportDesign } from '@getv.design/export';
const { files, notes } = await exportFile('deck.vd', { format: 'pdf' });
for (const file of files) await writeFile(file.name, file.bytes);
// A design you hold as text; font paths are read relative to `fontsFrom`.
const result = await exportDesign(source, { format: 'png', scale: 2, frames: ['cover'] });
A request that cannot be met at all (a frame that does not exist, a size no encoder can
hold) throws ExportError. A design with problems never does: it is drawn as well as it can
be, and notes says what was not drawn as asked.
Fonts
A design is drawn with, in order: the fonts it carries or names by path, the folders you hand over, the fonts installed on the machine, and Inter, which is in the package.
npx vdesign-export deck.vd -f pdf --fonts ./brand-fonts # a folder of .ttf, .otf or .ttc
npx vdesign-export deck.vd -f pdf --fonts ./brand-fonts --no-system-fonts
await exportFile('deck.vd', { format: 'pdf', fonts: ['./brand-fonts'], systemFonts: false });
--no-system-fonts (systemFonts: false) leaves the machine's fonts out, so the export is
the same wherever it runs. A font nobody has is drawn in Inter and reported in notes.
A deck that came from PowerPoint often names Calibri, Cambria, Arial or Times New Roman.
Where those are not installed, put their open stand-ins in a folder you pass as fonts:
Carlito, Caladea, Liberation Sans and Liberation Serif have the same widths, so lines break
where they did. The design keeps saying Calibri, and notes says what drew it.
PowerPoint
A slide per frame, with shapes and text that stay editable, and the fonts embedded in the
deck where their licence allows. text: 'outline' (or --text outline) draws text as
shapes instead, exact on any machine.
MP4
Not here: Node has no H.264 encoder, so video is made by the vDesign app. GIF works.
Licence
Free to use, including commercially, under the vDesign Export Licence in LICENSE. The
.vd format itself is open (CC BY 4.0). Third-party components, including the WebAssembly
renderers and the Inter fonts, are listed with their licences in THIRD_PARTY_NOTICES.txt.
Version 0.6.1.