Skip to content

emf-converterEMF and WMF to PNG, JPEG, WebP, SVG or PDF

A TypeScript library with no runtime dependencies. Runs in the browser, in Web Workers and in Node.js.

Live demo ​

Select or drop an .emf or .wmf file. The file is converted in your browser and is not uploaded anywhere.

Example ​

ts
import {
	convertMetafileToDataUrl,
	convertMetafileToJpegDataUrl,
	convertMetafileToPdf,
	convertMetafileToSvg,
	convertMetafileToWebpDataUrl,
} from 'emf-converter';

const buffer: ArrayBuffer = await file.arrayBuffer();

const png = await convertMetafileToDataUrl(buffer); // "data:image/png;base64,..."
const jpeg = await convertMetafileToJpegDataUrl(buffer); // "data:image/jpeg;base64,..."
const webp = await convertMetafileToWebpDataUrl(buffer); // "data:image/webp;base64,..."
const svg = await convertMetafileToSvg(buffer); // "<svg ...>...</svg>"
const pdf = await convertMetafileToPdf(buffer); // Uint8Array of a PDF file

See Getting started for installation and Usage for more examples.

Released under the Apache-2.0 License.