emf-converter 1.4.0 โ†’ 1.4.2

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 +13 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # emf-converter
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/emf-converter.svg)](https://www.npmjs.com/package/emf-converter)
4
- [![license](https://img.shields.io/npm/l/emf-converter.svg)](https://github.com/ChristopherVR/pptx-viewer/blob/main/LICENSE)
4
+ [![CI](https://github.com/ChristopherVR/emf-converter/actions/workflows/ci.yml/badge.svg)](https://github.com/ChristopherVR/emf-converter/actions/workflows/ci.yml)
5
+ [![license](https://img.shields.io/npm/l/emf-converter.svg)](LICENSE)
5
6
 
6
- A zero-dependency TypeScript library that converts **EMF** (Enhanced Metafile) and **WMF** (Windows Metafile) binary buffers into **PNG data URLs** by parsing their record streams and replaying drawing commands onto an HTML Canvas.
7
+ A zero-dependency TypeScript library that converts **EMF** (Enhanced Metafile) and **WMF** (Windows Metafile) binary buffers into **PNG data URLs** by parsing their record streams and replaying the drawing commands onto an HTML Canvas.
7
8
 
8
- Windows Metafiles store a sequence of GDI drawing commands and are commonly embedded inside Office documents (PPTX, DOCX). This converter reads the raw binary, interprets each record, and replays the drawing operations onto a Canvas to produce a rasterised PNG. It handles three formats:
9
+ Windows Metafiles store a sequence of GDI drawing commands and are commonly embedded inside Office documents (Word, PowerPoint) and Windows clipboard data. This converter reads the raw binary, interprets each record, and replays the drawing operations onto a Canvas to produce a rasterised PNG. It handles three formats:
9
10
 
10
11
  | Format | Description | Coordinate system |
11
12
  | -------- | ------------------------------ | ----------------------- |
@@ -13,10 +14,16 @@ Windows Metafiles store a sequence of GDI drawing commands and are commonly embe
13
14
  | **EMF** | Enhanced Metafile (32-bit GDI) | Bounds-based scaling |
14
15
  | **EMF+** | GDI+ extension embedded in EMF | World transform matrix |
15
16
 
16
- <samp>**[๐Ÿ“ฆ npm](https://www.npmjs.com/package/emf-converter)** ยท **[๐Ÿ“– Full docs](https://christophervr.github.io/pptx-viewer/)**</samp>
17
+ <samp>**[โ–ถ๏ธ Live demo](https://christophervr.github.io/emf-converter/)** ยท **[๐Ÿ“ฆ npm](https://www.npmjs.com/package/emf-converter)**</samp>
17
18
 
18
19
  ---
19
20
 
21
+ ## Demo
22
+
23
+ Try it right in your browser โ€” drop in an `.emf` or `.wmf` file and see the rendered PNG, conversion time, and output size:
24
+
25
+ **https://christophervr.github.io/emf-converter/**
26
+
20
27
  ## Install
21
28
 
22
29
  ```bash
@@ -57,7 +64,7 @@ Both functions return `Promise<string | null>` โ€” `null` if the buffer is inval
57
64
 
58
65
  A three-phase pipeline: **parse โ†’ replay โ†’ export**. The header parser extracts the drawing bounds, a Canvas is created and clamped to 4096ร—4096, then records are scanned sequentially and dispatched to GDI, EMF+, or WMF handlers that drive the Canvas 2D context. Embedded bitmaps (DIB and GDI+ pixel formats) and recursively embedded metafiles are resolved asynchronously after the synchronous replay completes.
59
66
 
60
- It supports 300+ EMF GDI record types, the EMF+ (GDI+) record set, and legacy WMF records, including state, transforms, objects, shapes, poly/path operations, text, bitmaps, and clipping. For the full record-type coverage, coordinate-system details, object tables, and module maps, see the [full documentation](https://christophervr.github.io/pptx-viewer/).
67
+ It supports 300+ EMF GDI record types, the EMF+ (GDI+) record set, and legacy WMF records, including state, transforms, objects, shapes, poly/path operations, text, bitmaps, and clipping.
61
68
 
62
69
  ## Limitations
63
70
 
@@ -70,4 +77,4 @@ It supports 300+ EMF GDI record types, the EMF+ (GDI+) record set, and legacy WM
70
77
 
71
78
  ## License
72
79
 
73
- [Apache-2.0](LICENSE). Please keep the [`NOTICE`](NOTICE) file with redistributions.
80
+ [Apache-2.0](LICENSE) โ€” free for commercial and closed-source use, with an explicit patent grant.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emf-converter",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Convert EMF/WMF metafile binaries to PNG data URLs using Canvas",
5
5
  "keywords": [
6
6
  "canvas",