wmf

WebJar for wmf

Лицензия

Лицензия

Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

wmf
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

wmf
WebJar for wmf
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/SheetJS/js-wmf

Скачать wmf

Имя Файла Размер
wmf-1.0.2.pom
wmf-1.0.2.jar 73 KB
wmf-1.0.2-sources.jar 22 bytes
wmf-1.0.2-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/wmf/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>wmf</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/wmf/
implementation 'org.webjars.npm:wmf:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/wmf/
implementation ("org.webjars.npm:wmf:1.0.2")
'org.webjars.npm:wmf:jar:1.0.2'
<dependency org="org.webjars.npm" name="wmf" rev="1.0.2">
  <artifact name="wmf" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='wmf', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "wmf" % "1.0.2"
[org.webjars.npm/wmf "1.0.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

js-wmf

Processor for Windows MetaFile (WMF) files in JS (for the browser and nodejs).

Installation

With npm:

$ npm install wmf

In the browser:

<script src="wmf.js"></script>

The browser exposes a variable WMF.

Usage

The data argument is expected to be an ArrayBuffer, Uint8Array or Buffer

  • WMF.image_size(data) extracts the image offset and extents, returns an Array [width, height] where both metrics are measured in pixels.

  • WMF.draw_canvas(data, canvas) parses the WMF and draws to a Canvas.

Notes

  • The library assumes the global ImageData is available. For nodejs-powered canvas implementations, a shim must be exposed as a global. Using the canvas npm package:
const { createImageData } = require("canvas");
global.ImageData = createImageData;
  • OffscreenCanvas in Chrome and some other Canvas implementations require the dimensions in the constructor:
const size = WMF.image_size(data);
const canvas = new OffscreenCanvas(size[0], size[1]);

Examples

Browser Fetch into canvas (click to show)
// assume `canvas` is a DOM element
(async() => {
  const res = await fetch("url/for/image.wmf");
  const ab = await res.arrayBuffer();
  WMF.draw_canvas(ab, document.getElementById("canvas"));
})();
NodeJS (using `canvas` npm module) (click to show)
const { createCanvas, createImageData } = require("canvas");
global.ImageData = createImageData;

const size = WMF.image_size(data);
const canvas = createCanvas(size[0], size[1]);
WMF.draw_canvas(data, canvas);

License

Please consult the attached LICENSE file for details. All rights not explicitly granted by the Apache 2.0 License are reserved by the Original Author.

References

  • MS-WMF: Windows Metafile Format
org.webjars.npm

SheetJS

Truly Open Source Data Tools and Miscellany

Версии библиотеки

Версия
1.0.2