Giter VIP home page Giter VIP logo

electron-printer's Introduction

electron-printer

node-printer fork to be used with electron. It's a fork from node-printer which binary are released on github. It's a temporary solution until binary package will be available for node 5.1.x and windows / linux platforms for node-printer on electron runtime. Please refer to https://github.com/tojocky/node-printer on how to use these APIs.

Prerequisite

Install the node version used by electron (currently is 5.1.1 for electron 0.36.7). A github valid NODE_PRE_GYP_GITHUB_TOKEN must be set as env variable.

Release & Build

Remember to change the binary host with the correct version (see https://github.com/bchr02/node-pre-gyp-github). After the release, build the binaries for each OS.

Linux build

On Ubuntu 15.10, install:

sudo apt-get install libudev-dev libusb-1.0-0-dev g++-multilib libudev-dev:i386 libcups2-dev

And then run npm run release-linux (x64) or npm run release-linux-ia32 (ia32) to publish the binary build

Windows build

Use a Windows 7 on x64. Install Visual Studio (2013 is OK on Windows 7) and Python 2.7.x Always specify the VisualStudio version using --msvs_version=xxxx, foor instance npm i --msvs_version=2013

Release using npm run release-win --msvs_version=2013 (x64) or npm run release-win-ia32 --msvs_version=2013 (ia32)

OSx build

After npm i, just use npm run release-darwin (npm run release should work)

electron-printer's People

Contributors

alexeyst avatar chieffancypants avatar duncanhall avatar ericz avatar gitawego avatar gitter-badger avatar kpitn avatar marcopiraccini avatar rvanzon avatar tojocky avatar vtardia avatar whitef0x0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

electron-printer's Issues

Error in Debian 8.3

On Debian, the module fails with this error:

App threw an error when running [Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /home/gabriel/app/node_modules/electron-printer/build/Release/electron-v0.36-linux-x64/node_printer.node)] A JavaScript error occurred in the main process Uncaught Exception: Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: versionGLIBCXX_3.4.21' not found (required by /home/gabriel/app/node_modules/electron-printer/build/Release/electron-v0.36-linux-x64/node_printer.node)
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:450:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/home/gabriel/app/node_modules/electron-printer/printer.js:4:42)
at Module._compile (module.js:425:26)
Environment:

Debian 8.3
[email protected]
[email protected]

The installed libstdc only has lib version up to 20:

$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_DEBUG_MESSAGE_LENGTH

Building the binaries in a previous version of Ubuntu (i.e. 15.04) should solve the issue.

Thanks!

Compatibility with electron-prebuild 1.2.x

Hi,

we want to use this library but have to resort to an older electron-prebuild version because this module does not work with newer electron (and thus node 6) versions.

With newer versions we get an error like Uncaught Error: Module version mismatch. Expected 48, got 47. Everything works fine with electron-prebuild 1.0.2 (which uses node 5.10).

Sadly some other modules are not compatible with that electron-prebuild version and using an older node version isn't preferable either.

Would it be possible to make this module compatible with newer node / electron versions?

Thanks!

Details for installing on windows

Can you give me a more detailed explanation of how to install this module.

This is the actual explanation:

Use a Windows 7 on x64. Install Visual Studio (2013 is OK on Windows 7) and Python 2.7.x Always specify the VisualStudio version using --msvs_version=xxxx, foor instancenpm i --msvs_version=2013

Release using npm run release-win --msvs_version=2013 (x64) or npm run release-win-ia32 --msvs_version=2013 (ia32)

I have these questions:

  • It is not possible to install simply using npm install electron-printer?
  • To build I need to download the zip, extract it and only then follow your instructions, right?
  • If I have Win 10 (64 bits) and have installed visual studio community version 2015 do I have to use npm run release-win --msvs_version=2015?

These are basics questions, but i'm clueless right now...

Thanks for the help

Rebuild failed

We are trying create billing system using pos printer. Desktop app create in angular 7 and electron . but when we install electron-printer install successfull but version problem . try to npm install message An unhandled error occurred inside electron-rebuild . node version - v13.3.0, npm version - 6.13.6.
,
electron-printer

fatal error: too many errors emitted, stopping now [-ferror-limit=] 23 warnings and 20 errors generated.

some errors:

../src/node_printer.hpp:123:39:** error: no member named 'Handle' in namespace 'v8'
bool getStringOrBufferFromV8Value(v8::Handlev8::Value iV8Value, std::string &oData);
~~~~^
../src/node_printer.hpp:123:55: error: expected '(' for function-style cast or type construction
bool getStringOrBufferFromV8Value(v8::Handlev8::Value iV8Value, std::string &oData);
~~~~~~~~~^
../src/node_printer.hpp:123:57: error: use of undeclared identifier 'iV8Value'
bool getStringOrBufferFromV8Value(v8::Handlev8::Value iV8Value, std::string &oData);
^
../src/node_printer.hpp:123:79: error: expected '(' for function-style cast or type construction
bool getStringOrBufferFromV8Value(v8::Handlev8::Value iV8Value, std::string &oData);
~~~~~~~~~~~ ^
../src/node_printer.hpp:123:80: error: use of undeclared identifier 'oData'
bool getStringOrBufferFromV8Value(v8::Handlev8::Value iV8Value, std::string &oData);
^
../src/node_printer_posix.cc:70:59: error: no template named 'Handle' in namespace 'v8'
std::string parseJobObject(const cups_job_t *job, v8::Handlev8::Object result_printer_job)
../src/node_printer_posix.cc:126:10: error: variable has incomplete type 'void'
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:33: error: no member named 'Handle' in namespace 'v8'
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
~~~~^
../src/node_printer_posix.cc:126:50: error: expected '(' for function-style cast or type construction
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
~~~~~~~~~~^
../src/node_printer_posix.cc:126:52: error: use of undeclared identifier 'ppd_options'
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:65: error: unexpected type name 'ppd_file_t': expected expression
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:78: error: use of undeclared identifier 'ppd'
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:83: error: unexpected type name 'ppd_group_t': expected expression
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:96: error: use of undeclared identifier 'group'
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
../src/node_printer_posix.cc:126:102: error: expected ';' after top level declarator
void populatePpdOptions(v8::Handlev8::Object ppd_options, ppd_file_t *ppd, ppd_group_t *group)
^
;
../src/node_printer_posix.cc:283:21: error: use of undeclared identifier 'parsePrinterInfo'
error_str = parsePrinterInfo(printer, result_printer);

doesn't work with Windows 7

Hi,

the published fork doesn't work with Windows 7. On Ubuntu it works, but only for Ubuntu. If i create the Windows Program-Files with Ubuntu, i get errors with this printer library. On Windows, npm stucks and makes a few errors... Can you publish precompiled sources for windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.