Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron support? #4

Closed
rcrodrigues opened this issue May 17, 2017 · 5 comments
Closed

Electron support? #4

rcrodrigues opened this issue May 17, 2017 · 5 comments

Comments

@rcrodrigues
Copy link

rcrodrigues commented May 17, 2017

Hey, I got here from the phantom-html2pdf
I'm searching for a library that supports Electron. I tried to run in my alectron app, but no success.
Got an error when spawning the child process. Probably because of ASAR files. Any tips maybe?

@SamVerschueren
Copy link
Owner

Not sure why it doesn't work. What's the error?

@sindresorhus Any ideas? It uses basically the same technique as Pageres. The only thing different is that I write to a temporary file and read that file again in order to return a Buffer.

@sindresorhus
Copy link

child_process.spawn() doesn't yet work with ASAR. See (and vote up!): electron/electron#9459

@rcrodrigues
Copy link
Author

rcrodrigues commented May 17, 2017

Thanks @SamVerschueren and @sindresorhus for the quick reply!

When using phanton-hmtl2pdf, in the convert method, i.g., a parameter of the child_process.spawn()
is a file inside the ASAR packed app files ("phantom-script.js"). As @sindresorhus stated, I believe it's then an Electron problem.

@rcrodrigues
Copy link
Author

rcrodrigues commented May 19, 2017

Just letting you guys know, I managed to make it work in an Electron app by making the installer unpack this lib after the app is copied to the target, so it won't be located in ASAR file. Thanks again for the support!

@SamVerschueren
Copy link
Owner

Thanks for the information regarding the topic @rcrodrigues and @sindresorhus. Going to close this as it's not something I can deal with from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants