Convert HTML to PDF using Headless Chrome in PHP

Ha Nguyen

January 2, 2024

There are times when you want to convert HTML to PDF. For instance, if you’re building a web application that allows users to generate PDFs of their invoices, you might want to convert the HTML of the invoice to PDF. Or if you’re building a blog, you might want to convert your blog posts to PDFs.


Sure, there are a lot of dedicated libraries like wkhtmltopdf that can do this for you.


But this can also be done using Headless Chrome as well. And the best part is, you don’t need to install any additional libraries to do this.


Please read more on:


Save my information in this browser for the next time I comment
Comment anonymously
Vitex Vitex Vietnam Software., JSC

Service Request Form

Send us your service request and we will get back to you instantly

1 Contact Infomation
  • Name
  • Email
  • Phone
  • Company
  • Address
  • Skype/Telegram
2 Service Request
Mobile Application
Website Application
  • Start time
    icon time
  • End time
    icon time
  • What is your budget range?
    icon time
    Currency USD
  • Front-end
    Ex. React, VueS...
  • Back-end
    Ex. PHP, Java, Python...
  • Database
    Ex. MySQL, Mongo...
  • Advanced technologies
    Ex. Blockchain, AI...
  • Select role
    icon time
  • Quantity
    icon time
  • Duration
    icon time

Request Form Successfully !

We' ll contact you in the earliest time.