emf-converter 2.0.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,6 +18,21 @@ Windows Metafiles store a sequence of GDI drawing commands and are commonly embe
18
18
 
19
19
  ---
20
20
 
21
+ ## Breaking change: `convertEmfToDataUrl` / `convertWmfToDataUrl` removed
22
+
23
+ Versions before 3.0.0 exported two functions, `convertEmfToDataUrl(buffer, options?)` and `convertWmfToDataUrl(buffer, options?)`. They have been replaced by a single auto-detecting function:
24
+
25
+ ```diff
26
+ -import { convertEmfToDataUrl, convertWmfToDataUrl } from 'emf-converter';
27
+ -const emfPng = await convertEmfToDataUrl(emfBuffer);
28
+ -const wmfPng = await convertWmfToDataUrl(wmfBuffer);
29
+ +import { convertMetafileToDataUrl } from 'emf-converter';
30
+ +const emfPng = await convertMetafileToDataUrl(emfBuffer);
31
+ +const wmfPng = await convertMetafileToDataUrl(wmfBuffer);
32
+ ```
33
+
34
+ `convertMetafileToDataUrl` detects the format from the buffer itself, so the same call works for either. See "Quick start" below.
35
+
21
36
  ## Demo
22
37
 
23
38
  Try it right in your browser: drop in an `.emf` or `.wmf` file and see the rendered PNG, conversion time, and output size:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emf-converter",
3
- "version": "2.0.4",
3
+ "version": "3.0.0",
4
4
  "description": "Convert EMF/WMF metafile binaries to PNG data URLs using Canvas",
5
5
  "keywords": [
6
6
  "canvas",