fraserxu / electron-pdf

📄 A command line tool to generate PDF from URL, HTML or Markdown files.
MIT License
1.24k stars 136 forks source link

Electron-pdf is taking 13-17 sec to convert 3 pages html to PDF #225

Open MStefanov opened 6 years ago

MStefanov commented 6 years ago

Hello, I have been researching different tools, libraries and utilities for converting html to pdf and I came across electron-pdf. It is working very well for most of my cases - the output is accurate as I expected it to be (which was not the case with most of the other tools). However the generation is very slow - for the same html some of the utilities need 3-5 sec and electron-pdf needs 13-17 sec. Probably I am not using it correctly or there is some additional configuration - an argument that should be passed along with the command. For the moment I have electron-pdf on Windows 10 machine and I am using it through powershell or cmd. I am using the following command: electron-pdf --waitForJSEvent. The html is hosted in S3 - https://s3-eu-west-1.amazonaws.com/generali-template-pregiotek/Generali+Template/index.html This is actually an index.html file which references other pages and .css styles. This is why we used --waitForJSEvent. If the argument is not passed, then empty .pdf is generated. Maybe this is the reason for the delay. If so is there a way to speed up the process - either by passing additional arguments to electron-pdf or adjusting the way the .html is constructed? Please advise.

Thank you for your time and consideration.

Best regards, Mariyan