TypeError: a.split is not a function.
See original GitHub issueHello everyone, sorry my english is not very well.
I have a problem when I try to convert a file, I already installed Ghostscript and GraphicsMagick, can someone help me?
(node:8980) UnhandledPromiseRejectionWarning: TypeError: a.split is not a function at t.value (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\pdf2pic\dist\index.min.js:1:1343) at C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\pdf2pic\dist\index.min.js:1:1586 at Promise._execute (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\bluebird\js\release\debuggability.js:313:9) at Promise._resolveFromExecutor (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\bluebird\js\release\promise.js:488:18) at new Promise (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\bluebird\js\release\promise.js:79:10) at t.value (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\pdf2pic\dist\index.min.js:1:1558) at t.<anonymous> (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\pdf2pic\dist\index.min.js:1:5951) at tryCatch (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\regenerator-runtime\runtime.js:45:40) at Generator.invoke [as _invoke] (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\regenerator-runtime\runtime.js:271:22) at Generator.prototype.(anonymous function) [as next] (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\regenerator-runtime\runtime.js:97:21) at asyncGeneratorStep (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24) at _next (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9) at C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\@babel\runtime\helpers\asyncToGenerator.js:32:7 at new Promise (<anonymous>) at t.<anonymous> (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\@babel\runtime\helpers\asyncToGenerator.js:21:12) at t._createClass.value (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\pdf2pic\dist\index.min.js:1:6078) (node:8980) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:8980) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:8980) UnhandledPromiseRejectionWarning: Error: Could not execute GraphicsMagick/ImageMagick: gm "identify" "-ping" "-format" "%p" "sample.pdf" this most likely means the gm/convert binaries can't be found at ChildProcess.<anonymous> (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\gm\lib\command.js:232:12) at ChildProcess.emit (events.js:189:13) at ChildProcess.cp.emit (C:\Users\fagner.batista\Documents\apiPdfLinux\node_modules\cross-spawn\lib\enoent.js:36:37) at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) (node:8980) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@shimonbrandsdorfer I have updated the read me file.
density
can actually accept numerical value,size
however accepts string.Here worked very well without the ‘-1’. I used ‘for’ to iterate on each page of the pdf. I would like to know if the function returns the page number of the pdf, to use dynamically in the ‘for’. instead of using the number 6.
async function convertePdf () { for (let i = 1; i <= 6; i++) { await pdf2pic.convert(“sample.pdf”, [i]).then(resolve => { console.log(“image converter successfully!”)
}