Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zengxiaoluan/react-svg-pdf


https://github.com/zengxiaoluan/react-svg-pdf

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

# react-svg-pdf

The goal of `react-svg-pdf` is to help you build pdf more easily, If you know how to create svg, you also know how to create pdf.

## How to use?

```shell
npm i react-svg-pdf -S
```

Next, you can write your familiar SVG code like below, that will make a heart for you.

```jsx
import ReactPDF from "react-svg-pdf";
import React from "react";
import jsPDF from "jspdf";

function App() {
return (
<>

>
);
}

let pdf = new jsPDF({ orientation: "p" });

ReactPDF.render(


,

pdf,
() => {
let embed = document.getElementById("app") as HTMLEmbedElement;
if (embed) embed.src = pdf.output("bloburi") as any;
}
);

```