eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Who wasted their time on this?

Nick- opened this issue · comments

Right click print save as PDF has already been a solution for this.. Let's use our skills to solve real problems going forward OK?

@Nick- That was very unfortunate comment. If you don't experience html to pdf or any other experience, you will never going forward.

@Nick- Javascript, even when limited to the web browser, has an enormous range of applications, perhaps more than any other programming language. Suppose you have 10 000 html sites that you want to convert to pdf. Will you pay me whatever the going rate for such labour is in your area, to manually right click print save as PDF on every single one? (If you will, please contact me, I could use the income 😂)

As a specific example, the company where I work uses this library in a visitor management application which runs on an iPad mounted in kiosks in the reception area of various offices. Visitors to the office are asked to read and sign a safety agreement when they arrive, which is rendered in html. In the background, the app automatically converts the signed copy to a PDF, uploads it to amazon S3, and sends the visitor an email with a copy of the agreement attached. The company using this app can also access a web portal where they can view their visitors and see all of the signed agreements, for auditing/compliance purposes.

Your alternative is that the visitor should instead "Right click print save as PDF" (none of which exist in the iPad context), and then what? Go into the Mail app on the iPad, and send themselves and their host a copy of this agreement, and then some kind of separate email scraping service will collect the PDFs into a single place for the host company to review later?

Good use case, thanks for explaining

This should be closed now.

To ChatGPT:

There's a dude on Github not understanding the great use cases html2pdf.js could have. He put a comment in the Issues section:

Right click print save as PDF has already been a solution for this.. Let's use our skills to solve real problems going forward OK?

Please help him out, by explaining to him why this project is important.

Its response:

Hi @Nick-

Thanks for sharing your perspective. You're right that the right-click, print, and save as PDF method provides a straightforward way to convert web content into a PDF format. However, html2pdf.js offers several key advantages that cater to more complex and automated needs which this basic method can't fulfill.

  • Programmatic Control: html2pdf.js allows developers to programmatically control the conversion process. This means that web applications can dynamically generate PDFs based on user interactions or data changes without requiring manual intervention from the user.
  • Customization and Consistency: While the print-to-PDF feature depends heavily on the browser and user settings, html2pdf.js provides consistent output across different environments. It also allows for more advanced customization, such as setting specific margins, page sizes, or even adding headers and footers, which are crucial for professional-looking documents.
  • Automation and Integration: In scenarios where PDF generation needs to be part of an automated workflow (like generating reports, invoices, or receipts in response to certain triggers), html2pdf.js becomes invaluable. It integrates seamlessly into the backend processes, unlike the manual print-to-PDF method.
  • Accessibility and User Experience: Not all users may find the print-to-PDF approach intuitive or accessible, especially those who are not tech-savvy. Having a one-click solution within the web application enhances user experience and accessibility.
  • Performance and Load Handling: For web applications dealing with high volumes of content or complex layouts, html2pdf.js can handle the conversion more efficiently, reducing the load on the client's browser and providing faster results.

In conclusion, while right-click, print, and save as PDF works for individual, ad-hoc cases, html2pdf.js extends the functionality to meet the needs of dynamic, automated, and professional web applications. It's about enhancing capabilities and providing solutions that cater to a wider range of scenarios.


I personally think ChatGPT is way too subtle for you. But now this 'issue' can be closed. And please try to be constructive on this platform.

close this please

Seems pretty useful as I have, for example, navigation buttons on a page that I don't want to be included in the PDF. and it provides users with a convenient "download PDF" button amongst those. Better UX overall.