thnew / pdf2png Goto Github PK
View Code? Open in Web Editor NEWA NodeJS module, converting PDFs to PNG
A NodeJS module, converting PDFs to PNG
I got this working on the local machine (windows). I'm having trouble getting it to run by replacing the path when deploying to heroku. Any tips?
Wanted to know if it's possible to use the script without specially doing apt-get on linux instead have the executable in linux format and simply run the process
How to convert nth page of a pdf file to png image?
which I mean.
I converted a PDF file which holds 8 pages in it, but resulted by converting only first page of a pdf file to a png image, but I need a whole.
Thanks in advance.
Hi,
It's working fine in case of Path : C:\Users\Test\Image\1\sample_image.png
But when I am passing Path: C:\Users\Test\Image\1\sample image.png
it is not working. So when there is space in a folder name or file name it is not working.
Can you please suggest how to resolve this issue.
Got Workaround by copping files.
Regards,
Kalpan
With the sample code, it seems to just convert the 1st page of the PDF to PNG.
Your examples don't show multiple images like the other mp fork does. Will this one work if I use their multiple page example code?
Hello!
How i can get several png-image if i have several paged in png-file?
I'm using this locally (and then pushing it out to production); however, I was caught with this error:
{
success: false,
error: 'Error converting pdf to png: Error: spawn ENOENT'
}
Any ideas on how to fix it?
I have confirmed with Microsoft that their Windows sandbox blocks the use of pdf2png and other PDF related libraries. I've tested my app in both v1 and v2 of Azure Functions.
See the references here to the restrictions
https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks
and some references to PDF things that violate these restrictions.
You say pdf2png was tested in Azure. Can you tell me how you deployed it to Azure? Also, any idea what in pdf2png might be violating? Microsoft didn't tell me exactly what pdf2png violates.
I'd really like to get it working in my Azure Function, without have to move to my own VM that would remove the sandbox restriction.
Any ideas?
Thanks,
Donnie
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:137:11)
at Object.unlink (fs.js:936:14)
at C:\[DIR]\node_modules\pdf2png-mp2\lib\pdf2png.js:53:6
at ChildProcess.exithandler (child_process.js:280:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
I can't currently use this library because of that problem. Is there any solution ?
Thank you !
First of all great work with this npm, thank you very much @thnew . As me(@matex1024) and my friend(@eduardomourar) use this library from time to time but we don't want to fork this project or create new project based on that one, it's better to maintain this one then create clones.
For the issue reason I just want say there is new version of ghostScript that has few important changes for out project. We tested changes of new ghostScript just please add as contributors.
Thanks and Best Regars
MatAng
Any ideas on what might be causing this error?
Something went wrong: Error reading pdf: Error: Command failed: gs -q -dNODISPLAY -c "(/Users/donniekerr/Documents/work/pdf2png/pdf2png/input/W-4-KERR.pdf) (r) file runpdfbegin pdfpagecount = quit"
[5/15/20 4:06:53 PM] GPL Ghostscript 9.52: Unrecoverable error, exit code 1
Is it possible to convert a multiple page pdf file into pngs? For example a 3 site pdf would create "test(1).png", "test(2).png" and "test(3).png".
So far I was only be able to convert the first page of a pdf file.
base64 is not allowed and input big binary buffer is not allowed,too
Hi, I am a chinese boy, and my english is wrong, so, first of all, I want to say sorry.
I am a beginner of nodejs, when I use your module, I found:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.