{"_id":"@banzai-inc/react-to-pdf","_rev":"1-19c0d51eaa2e85ec3ed8f50e9cd1a5a4","name":"@banzai-inc/react-to-pdf","dist-tags":{"latest":"0.0.15"},"versions":{"0.0.14":{"name":"@banzai-inc/react-to-pdf","version":"0.0.14","description":"Create pdf documents from React Components","main":"lib/index.js","module":"umd/react-to-pdf.js","jsnext:main":"umd/react-to-pdf.js","keywords":["pdf","react","convert"],"scripts":{"start":"styleguidist server","test":"echo \"Error: no test specified\" && exit 0","build":"npm run build:commonjs && npm run build:umd && npm run build:umd:min","clean":"rimraf lib/ umd/ && mkdir -p lib umd","release":"yarn build && yarn version --new-version patch && npm publish","prepare":"npm run clean && npm test && npm run build","lint":"eslint src","lint-fix":"eslint --fix src --ext .js","preversion":"yarn test","postversion":"git push","build:watch":"echo 'build && watch the COMMONJS version of the package - for other version, run specific tasks' && npm run build:commonjs:watch","build:commonjs":"cross-env BABEL_ENV=commonjs babel ./src/ReactToPdf.jsx --out-file ./lib/index.js","build:commonjs:watch":"npm run build:commonjs -- --watch","build:umd":"cross-env BABEL_ENV=umd babel ./src/ReactToPdf.jsx --out-file ./umd/react-to-pdf.js","build:umd:min":"cross-env BABEL_ENV=umd babel --presets minify ./src/ReactToPdf.jsx --out-file ./umd/react-to-pdf.min.js","build:umd:watch":"npm run build:umd -- --watch"},"repository":{"type":"git","url":"git+https://github.com/banzai-inc/react-to-pdf.git"},"author":{"name":"Marcos Andrei Ivanechtchuk"},"license":"MIT","bugs":{"url":"https://github.com/banzai-inc/react-to-pdf/issues"},"homepage":"https://github.com/banzai-inc/react-to-pdf#readme","dependencies":{"html2canvas":"1.0.0-alpha.12","jspdf":"^2.3.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-eslint":"^8.2.2","babel-loader":"7","babel-plugin-module-resolver":"^3.1.1","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-plugin-transform-react-remove-prop-types":"^0.4.24","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-flow":"^6.23.0","babel-preset-minify":"^0.5.1","babel-preset-react":"^6.24.1","chalk":"^2.4.1","cross-env":"^7.0.2","css-loader":"^1.0.0","env-cmd":"^8.0.2","eslint":"^6.8.0","eslint-config-airbnb":"^16.0.0","eslint-config-prettier":"^2.9.0","eslint-config-react-app":"^0.6.2","eslint-import-resolver-alias":"^1.0.3","eslint-import-resolver-babel-module":"^4.0.0","eslint-loader":"1.6.0","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jest":"^21.4.2","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-prettier":"^2.6.2","eslint-plugin-react":"^7.11.1","file-loader":"^2.0.0","jest":"^23.5.0","json5":"^2.0.1","lite-server":"^2.4.0","node-sass":"^4.9.3","open-browser-webpack-plugin":"^0.0.5","postcss-modules":"^1.3.2","prettier":"^1.14.3","prop-types":"^15.6.2","react":"^16.5.2","react-dom":"^16.5.2","react-styleguidist":"^7.3.8","rimraf":"^2.6.2","sass-loader":"^7.1.0","style-loader":"^0.23.0","url-loader":"^1.1.1","webpack":"^4.18.0"},"peerDependencies":{"react":"^16.5.2 || ^17.0.0","react-dom":"^16.5.2 || ^17.0.0"},"volta":{"node":"10.24.1"},"gitHead":"6ffadfe826aab662193f3b1c26d08616faeef2f2","_id":"@banzai-inc/react-to-pdf@0.0.14","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-w8lHGte9LMvauuFKGui/n/Gcm32gqGlR13zVcZsT/OI0xbUEXRXCihHeCG9BeHUlTUKg3g58taoOKsQHYthbdw==","shasum":"7bbe7cc33f21a5599e89ffa694fc96c933683b52","tarball":"https://registry.npmjs.org/@banzai-inc/react-to-pdf/-/react-to-pdf-0.0.14.tgz","fileCount":7,"unpackedSize":18077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkGUyujkkaFpGO6eneN3qMgY5o2ZbpN7MLZKWfHIvBnAiEAubYANE1mC35NmznAl3+1krPeuQjC4hoa5LRRgmbSHpU="}]},"_npmUser":{"name":"jaredbanzai","email":"jared@banzai.org"},"directories":{},"maintainers":[{"name":"jaredbanzai","email":"jared@banzai.org"},{"name":"buchanankendall","email":"kendall@teachbanzai.com"},{"name":"austinhollenbaugh","email":"austinhollenbaugh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-to-pdf_0.0.14_1684447041792_0.10805576663638439"},"_hasShrinkwrap":false},"0.0.15":{"name":"@banzai-inc/react-to-pdf","version":"0.0.15","description":"Create pdf documents from React Components","main":"lib/index.js","module":"umd/react-to-pdf.js","jsnext:main":"umd/react-to-pdf.js","keywords":["pdf","react","convert"],"scripts":{"start":"styleguidist server","test":"echo \"Error: no test specified\" && exit 0","build":"npm run build:commonjs && npm run build:umd && npm run build:umd:min","clean":"rimraf lib/ umd/ && mkdir -p lib umd","release":"yarn build && yarn version --new-version patch && npm publish","prepare":"npm run clean && npm test && npm run build","lint":"eslint src","lint-fix":"eslint --fix src --ext .js","preversion":"yarn test","postversion":"git push","build:watch":"echo 'build && watch the COMMONJS version of the package - for other version, run specific tasks' && npm run build:commonjs:watch","build:commonjs":"cross-env BABEL_ENV=commonjs babel ./src/ReactToPdf.jsx --out-file ./lib/index.js","build:commonjs:watch":"npm run build:commonjs -- --watch","build:umd":"cross-env BABEL_ENV=umd babel ./src/ReactToPdf.jsx --out-file ./umd/react-to-pdf.js","build:umd:min":"cross-env BABEL_ENV=umd babel --presets minify ./src/ReactToPdf.jsx --out-file ./umd/react-to-pdf.min.js","build:umd:watch":"npm run build:umd -- --watch"},"repository":{"type":"git","url":"git+https://github.com/banzai-inc/react-to-pdf.git"},"author":{"name":"Marcos Andrei Ivanechtchuk"},"license":"MIT","bugs":{"url":"https://github.com/banzai-inc/react-to-pdf/issues"},"homepage":"https://github.com/banzai-inc/react-to-pdf#readme","dependencies":{"html2canvas":"1.0.0-alpha.12","jspdf":"^2.3.1"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-eslint":"^8.2.2","babel-loader":"7","babel-plugin-module-resolver":"^3.1.1","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-plugin-transform-react-remove-prop-types":"^0.4.24","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-flow":"^6.23.0","babel-preset-minify":"^0.5.1","babel-preset-react":"^6.24.1","chalk":"^2.4.1","cross-env":"^7.0.2","css-loader":"^1.0.0","env-cmd":"^8.0.2","eslint":"^6.8.0","eslint-config-airbnb":"^16.0.0","eslint-config-prettier":"^2.9.0","eslint-config-react-app":"^0.6.2","eslint-import-resolver-alias":"^1.0.3","eslint-import-resolver-babel-module":"^4.0.0","eslint-loader":"1.6.0","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jest":"^21.4.2","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-prettier":"^2.6.2","eslint-plugin-react":"^7.11.1","file-loader":"^2.0.0","jest":"^23.5.0","json5":"^2.0.1","lite-server":"^2.4.0","node-sass":"^4.9.3","open-browser-webpack-plugin":"^0.0.5","postcss-modules":"^1.3.2","prettier":"^1.14.3","prop-types":"^15.6.2","react":"^16.5.2","react-dom":"^16.5.2","react-styleguidist":"^7.3.8","rimraf":"^2.6.2","sass-loader":"^7.1.0","style-loader":"^0.23.0","url-loader":"^1.1.1","webpack":"^4.18.0"},"peerDependencies":{"react":"^16.5.2 || ^17.0.0 || ^18.0.0","react-dom":"^16.5.2 || ^17.0.0 || ^18.0.0"},"volta":{"node":"10.24.1"},"gitHead":"8225131e8369cdf334bcfaf2eb237519efa4a980","_id":"@banzai-inc/react-to-pdf@0.0.15","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-8fGkmoHEm+kj1NmNvunXwymc2C9JU1Scqx2tXOrC3z+hzhTFnBGddkvV7/aUBL9gFJBtwEdIEfcvjNEC0ypXqA==","shasum":"2a6387fdd1cd9f5d725c78a94c644a0c8b1d9369","tarball":"https://registry.npmjs.org/@banzai-inc/react-to-pdf/-/react-to-pdf-0.0.15.tgz","fileCount":7,"unpackedSize":18099,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFW6QLjlUqQ22mISssPvkRED1LhDrtY5yLBtgn5v7DaTAiEAv7zxtCISjsuCCFIXzALRZ9o4gSRGUtTmaYyAM05CI3g="}]},"_npmUser":{"name":"jaredbanzai","email":"jared@banzai.org"},"directories":{},"maintainers":[{"name":"jaredbanzai","email":"jared@banzai.org"},{"name":"buchanankendall","email":"kendall@teachbanzai.com"},{"name":"austinhollenbaugh","email":"austinhollenbaugh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-to-pdf_0.0.15_1707927102986_0.4698547368816719"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-18T21:57:21.727Z","0.0.14":"2023-05-18T21:57:22.050Z","modified":"2024-02-14T16:11:43.313Z","0.0.15":"2024-02-14T16:11:43.143Z"},"maintainers":[{"name":"jaredbanzai","email":"jared@banzai.org"},{"name":"buchanankendall","email":"kendall@teachbanzai.com"},{"name":"austinhollenbaugh","email":"austinhollenbaugh@gmail.com"}],"description":"Create pdf documents from React Components","homepage":"https://github.com/banzai-inc/react-to-pdf#readme","keywords":["pdf","react","convert"],"repository":{"type":"git","url":"git+https://github.com/banzai-inc/react-to-pdf.git"},"author":{"name":"Marcos Andrei Ivanechtchuk"},"bugs":{"url":"https://github.com/banzai-inc/react-to-pdf/issues"},"license":"MIT","readme":"# React to PDF\n\nEasily create pdf documents from React components.\n\n## Install\n\n```\n$ npm install react-to-pdf\n```\n\n## Important Notes\n\n- No SSR\n- Single page\n- Not vectorized - the pdf is created from a screenshot of the component and therefore is not vectorized. If you are looking for something more advanced for generating pdf using React components, please check out other popular alternatives packages listed below.\n\n## Alternatives and Similars Packages\n\n* [@react-pdf/renderer](https://www.npmjs.com/package/@react-pdf/renderer) - React renderer for creating PDF files on the browser and server\n* [react-pdf](https://www.npmjs.com/package/react-pdf) - Display PDFs in your React app as easily as if they were images.\n\n\n## Examples\n\nhttps://codesandbox.io/s/l2l4pz0jyl\n\n## Usage\n\n**Using inner target ref**\n\n```jsx\n<ReactToPdf>\n    {({toPdf, targetRef}) =>  (\n        <div style={{width: 500, height: 500, background: 'red'}} onClick={toPdf} ref={targetRef}/>\n    )}\n</ReactToPdf>\n```\n\n**Using outer target ref**\n\n```jsx\nconst ref = React.createRef();\n\n<div>\n    <ReactToPdf targetRef={ref} filename=\"div-blue.pdf\">\n        {({toPdf}) => (\n            <button onClick={toPdf}>Generate pdf</button>\n        )}\n    </ReactToPdf>\n    <div style={{width: 500, height: 500, background: 'blue'}} ref={ref}/>\n</div>\n```\n\n**Advanced options**\n```jsx\nconst ref = React.createRef();\nconst options = {\n    orientation: 'landscape',\n    unit: 'in',\n    format: [4,2]\n};\n<div>\n    <ReactToPdf targetRef={ref} filename=\"div-blue.pdf\" options={options} x={.5} y={.5} scale={0.8}>\n        {({toPdf}) => (\n            <button onClick={toPdf}>Generate pdf</button>\n        )}\n    </ReactToPdf>\n    <div style={{width: 500, height: 500, background: 'blue'}} ref={ref}/>\n</div>\n```\n\n## Props\n\n|Prop name        |Type               |Default            |Description\n|-----------------|-------------------|-------------------|--------------------------------\n|filename         | `string`          | `'download.pdf'`  | Name of the pdf file\n|targetRef        | `RefObject`       |                   | [React ref](https://reactjs.org/docs/refs-and-the-dom.html) for the target component (use this or inner target reference)\n|x                | `number`          |         0         | X position in document\n|y                | `number`          |         0         | Y position in document\n|options          | `object`          |    `undefined`    | options for the jsPdf document - [view more details](https://rawgit.com/MrRio/jsPDF/master/docs/)\n|onComplete       | `function`        |    `undefined`    | callback executed when process is finished\n|scale            | `number`          |    1              | Image scaling","readmeFilename":"README.md"}