# render-html-into-canvas

> Get a plain HTML and renders into a canvas.

Latest version **1.2.3** (published 2022-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install render-html-into-canvas
pnpm add render-html-into-canvas
yarn add render-html-into-canvas
bun add render-html-into-canvas
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2022-11-01 |
| First published | 2022-10-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Uthan Hercules |
| Maintainers | hjlfgard |
| Keywords | html, canvas, style |

## Links

- npm: https://www.npmjs.com/package/render-html-into-canvas
- npm.io page: https://npm.io/package/render-html-into-canvas

## Dependencies (2)

- [canvas](https://npm.io/package/canvas.md) ^2.10.1
- [html2json](https://npm.io/package/html2json.md) ^1.0.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.2.3 (latest) — 2022-11-01
- 1.2.2 — 2022-10-28
- 1.2.1 — 2022-10-28
- 1.2.0 — 2022-10-28
- 1.1.2 — 2022-10-26
- 1.1.1 — 2022-10-26
- 1.1.0 — 2022-10-26
- 1.0.1 — 2022-10-19
- 1.0.0 — 2022-10-19

## README

## Render HTML to Canvas
Render a HTML text template into a canvas context.

```js
// To import
const drawHTML = require('render-html-into-canvas');

// To use
const canvas = yourCanvas;
const context = canvas.getContext('2d');

const input = "<b>Follow</b> the <i>train,</i> <b><i>CJ!</i></b><br><b>MOVE!</b>;

drawHTML(input, context, { fontFamily: 'Arial', fontSize: 16 });

// Available options
options: {
  fontFamily: 'string',
  fontSize: number,
  padding: number,
  posX: number,
  posY: number,
}
```

---
_Source: https://npm.io/package/render-html-into-canvas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
