Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A Simple Utility to render React JSX to PDF
$ npm i jsx-to-pdf
import { JsxToPdf } from "jsx-to-pdf";
function App() {
return (
<JsxToPdf>
{({ save, jsxRef, error, errorText }) => {
return (
<div className="App" ref={jsxRef}>
<button style={{ height: 50, margin: 20, backgroundColor: '#61dafb' }} onClick={save}>Download PDF for this Page</button>
</div>
)
}}
</JsxToPdf>
)
}
import { useJsxToPdf } from "jsx-to-pdf";
function App() {
const { jsxRef, convertToPdf } = useJsxToPdf()
return (
<div className="App" ref={jsxRef}>
<button style={{ height: 50, margin: 20, backgroundColor: '#61dafb' }} onClick={save}>Download PDF for this Page</button>
</div>
)
}
Name | Type | Default | Description |
---|---|---|---|
name | String | jsxToPdf | Name of the PDF to be saved |
scale | Number | 1 | Scale of the HTMLNodeElement element |
x | Number | 0 | Offset x of the PDF |
y | Number | 0 | Offset y of the PDF |
width | Number | JSPDF document width | Width of the HTMLNodeElement to be set in PDF |
height | Number | JSPDF document height | Height of the HTMLNodeElement to be set in PDF |
{...rest} | Object | {} | JSPDF options |
Name | Type | Default | Description |
---|---|---|---|
save | Function | () => {} | Trigger PDF Submit |
jsxRef | ref | undefined | Reference to the HTMLNodeElement |
loading | Boolean | false | Loader for PDF save |
error | Boolean | false | Error |
errorText | String | () => {} | Error Text |
Name | Type | Default | Description |
---|---|---|---|
convertToPDF | Function | () => {} | Trigger PDF Submit |
jsxRef | ref | undefined | Reference to the HTMLNodeElement |
loading | Boolean | false | Loader for PDF save |
error | Boolean | false | Error |
errorText | String | () => {} | Error Text |
Feel free to contact me or create an issue
FAQs
A Simple Utility to render React JSX to PDF
The npm package jsx-to-pdf receives a total of 11 weekly downloads. As such, jsx-to-pdf popularity was classified as not popular.
We found that jsx-to-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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.