# react-dom-to-pdf-byaasif

> Generates a printable paginated pdf from react DOM using HTML5 canvas and svg.

Latest version **1.0.2** (published 2022-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-dom-to-pdf-byaasif
pnpm add react-dom-to-pdf-byaasif
yarn add react-dom-to-pdf-byaasif
bun add react-dom-to-pdf-byaasif
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-01-25 |
| First published | 2022-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+15 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 152 |
| Author | Aasif Ansari |
| Maintainers | asfgpr |
| Keywords | javascript, dom, pdf, html, canvas, svg, client-side, print, paginate, page-break |

## Links

- npm: https://www.npmjs.com/package/react-dom-to-pdf-byaasif
- Repository: https://github.com/ovvn/dom-to-pdf
- Homepage: https://github.com/asfgpr/react-dom-to-pdf#readme
- Issues: https://github.com/asfgpr/react-dom-to-pdf/issues
- npm.io page: https://npm.io/package/react-dom-to-pdf-byaasif

## Dependencies (2)

- [jspdf](https://npm.io/package/jspdf.md) ^1.5.3
- [dom-to-image](https://npm.io/package/dom-to-image.md) git://github.com/dmapper/dom-to-image.git

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-01-25
- 1.0.1 — 2022-01-25
- 1.0.0 — 2022-01-25

## README

# dom-to-pdf

dom-to-pdf generates a printable PDF from DOM node using HTML5 canvas and svg.

## Install

```
npm install --save react-dom-to-pdf-byaasif
```

## Usage
```javascript
var domToPdf = require('react-dom-to-pdf-byaasif');

var element = document.getElementById('test');
var options = {
  filename: 'test.pdf'
};
domToPdf(element, options, function() {
  console.log('done');
});
```

## Options
* `filename` - string, name of resulted PDF file, default name is `generated.pdf`
* `excludeClassNames` - array of strings, list of class names of elements to exclude from PDF, e.g. `['Loading', 'ExcludeMeFromPdf']`
* `excludeTagNames` - array of strings, list of html tags to exclude from PDF, e.g. `['button', 'input', 'select']`
* `overrideWidth` - number, overrides a width of a container DOM element 
* `proxyUrl` - string, e.g. `/api/proxyImage?url=`, a route in your app which renders images on your domain in order to avoid problems with CORS with the images on a DOM
* `compression` - string, compression of the generated image, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'. (default is 'NONE')

---
_Source: https://npm.io/package/react-dom-to-pdf-byaasif · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
