
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
easy-react-pdf
Advanced tools
[](https://opensource.org/licenses/MIT)
The Easy React PDF is a library that simplifies the process of generating PDF files from JSON configurations. With this library, you can easily create complex PDF documents with various styles, layouts, and content. and make it easy for templating PDF files.
You can install the library using npm:
npm install easy-react-pdf
you need install react, react-pdf and react-dom in your project
npm install react react-dom @react-pdf/renderer
import { createStreamPDF, IPDFPage } from "easy-react-pdf";
async function main(template: IPDFPage) {
const stream = await createStreamPDF(template);
return stream.pipe(fs.createWriteStream("output.pdf"));
}
import { createFilePDF, IPDFPage } from "easy-react-pdf";
async function main(template: IPDFPage) {
await createFilePDF(template, "path/to/file.pdf");
}
import { PDFViewer } from "@react-pdf/renderer";
import { Document } from "easy-react-pdf";
function Main(template: IPDFPage) {
return (
<PDFViewer>
<Document {...template} />
</PDFViewer>
);
}
{
"contents": [
{
"type": "views",
"style": {
"width": "100%",
"height": "100%",
"alignItems": "center",
"justifyContent": "center",
"display": "flex"
},
"contents": [
{
"type": "text",
"text": "{{name}}",
"style": {
"fontSize": 30,
"fontWeight": "bold"
}
}
]
}
],
"document": {
"title": "Payment Schedules"
},
"pages": {
"size": "A4"
}
}
import { validateJsonPDF, validateObjectPDF } from "easy-react-pdf";
const validateJson = validateJsonPDF(contents);
const validateObject = validateObjectPDF(contents);
this function return a valid object or throw a error
import { replaceVariablesJson, replaceVariablesObject } from "easy-react-pdf";
const variables = [
{
name: "name",
value: "John Doe",
},
{
name: "age",
value: 20,
},
];
const templateJson = replaceVariablesJson(contents, variables);
const templateObject = replaceVariablesObject(contents, variables);
FAQs
[](https://opensource.org/licenses/MIT)
We found that easy-react-pdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.