blackbeam / poppler-simple

A simple javascript interface to poppler library
Apache License 2.0
37 stars 14 forks source link

Can't use it in windows 7x64 #16

Open vasilevich opened 7 years ago

vasilevich commented 7 years ago

Hello! I am sorry if this library was not intended to be used on a windows machine however it was not stated otherwise in its description. I've spent about 3 days now trying to compile it on windows 7 x64 with node-gyp enivorment set up properly(I think, since I can compile other native modules such as bcrypt) the bugs that I have encountered vary from : C:\projects\contracto\node_modules\poppler-simple>if not defined npm_config_node_gyp (node "C:\Program Files\nodej s\node_modules\npm\bin\node-gyp-bin\....\node_modules\n ode-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )

'v=process.versions.node.split(.); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at Object.exports.runInThisContext (vm.js:78:16) at Object. (eval-wrapper:6:22) at Module._compile (module.js:573:32) at Immediate. (bootstrap_node.js:383:29) at runCallback (timers.js:637:20) at tryOnImmediate (timers.js:610:5) at processImmediate [as _immediateCallback] (timers.j s:582:5) gyp: Call to 'node -pe 'v=process.versions.node.split("." ); v[0];'' returned exit status 1 while in binding.gyp. w hile trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program F iles\nodejs\node_modules\npm\node_modules\node-gyp\lib\co nfigure.js:305:16) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7)

gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C :\Program Files\nodejs\node_modules\npm\node_modules \node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\projects\contracto\node_modules\poppler-s imple gyp ERR! node -v v7.1.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\ Program Files\nodejs\node_modules\npm\bin\npm-cli.js " "install" "poppler-simple" npm ERR! node v7.1.0 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE

npm ERR! poppler-simple@0.2.5 install: (node-gyp rebuild ) || (exit 1)

I tried to fix these problems myself and after a long and frustrating battle got to the point where the only thing that cant compile is is "NodePopplerDocument.cc" missing: GlobalParams.h and poppler\doc.h and some more in the file NodePopplerDocument.h

which is the only file that yet does not compile.

can someone provide this module precompiled for windows 7 x64 please I need it only for development purpose and I am really lacking the knowledge to get it to work properly for me. alternatively can you provide me links or instructions how to properly and which versions of poppler and iconv to add to my windows enivorment path thank you very much.

blackbeam commented 7 years ago

Sorry but this library was not intended to be used on windows. Also my windows development experience is too limited to advice you anything. I think you need to link to libiconv and poppler (>= v0.18) somehow.

missing: GlobalParams.h and poppler\doc.h

Obviously you need poppler headers somewhere in your include dirs.

vasilevich commented 7 years ago

Can you advice what is the latest poppler version you tried? Maybe my poppler is too new? I am not sure anymore its a frustrating battle, do you think it's possible to cross compile it from a Linux box to windows or that makes no sense?

blackbeam commented 7 years ago

Can you advice what is the latest poppler version you tried?

Definitely works on v0.42.0.

do you think it's possible to cross compile it from a Linux box to windows or that makes no sense?

Don't know unfortunately.

its a frustrating battle

Maybe it is an option for you to wrap poppler binaries (pdfinfo, pdftocairo, pdftoppm) if they are available on Windows? It will be slower but may be enough if your target is not a high performance renderer.

vasilevich commented 7 years ago

thats what i ended up doing, i just wanted to make things more efficient, I like the idea of doing all in memory so much better. and the production server is linux, the only problem is that I develop it on my windows 7x64 machine, I wish I could do both, but I will move on for now, maybe some day come back to this and commit you a working windows fix, tho I never worked with C or anything related in a serious matter.