Closed webdeveloper0429 closed 7 years ago
hi! this package is designed to run in a node.js environment, not in the browser, i assume that you are trying to use it in the browser since you are mentioning React
what i mean is that you can't import this package in a React component, because phantom-html-to-pdf
is designed to import modules that are only present in node.js.
Thanks. then how can I use this in my project? I like this package since this has pagenum
then how can I use this in my project?
well you will have to use this package from a node.js backend/server and make a special http route (let's call it pdf route) that it is designed to receive http request and render pdf using this package, then from your React front-end you will need to call the pdf route (using AJAX), then handle the response and show it in the browser.
i will close the issue since this is not a problem, i will recommend you to try to look for some help in stackoverflow, there you will probably find people that are willing to help you in more questions that you will probably have.
Thank you.
Module not found: Error: Can't resolve 'fs' Module not found: Error: Can't resolve 'child_process' Module not found: Error: Can't resolve 'cluster' Module not found: Error: Can't resolve 'net' Module not found: Error: Can't resolve 'dns'
when I run project, these error shows. my project is React. I have no idea how to use this package...