I am building a website where a user can add data to a element on the HTML page. The data will consist of images and text. I am wondering if there is a way that I can export this data to a PDF or image format and allow the user to download it. Maybe a library? The website is using Javascript, PHP, HTML and CSS currently. I would love to be able to format the PDF to look a certain way as well. One of the most important things is that this software is usable by all modern browsers.

  • 1
    There are PDF libraries for PHP, e.g. TCPDF, which let you generate PDF documents. Would that be what you're looking for?
    – Izzy
    Jan 16, 2019 at 7:10
  • Glad to read! If it fits, maybe you want to answer your own question?
    – Izzy
    Jan 18, 2019 at 7:18

1 Answer 1


To achieve this I ended up using DOMPDF (https://github.com/dompdf/dompdf) which allowed me to write CSS and HTML to a PDF object in PHP and present this to the user. DOMPDF facilitates many of the CSS options that other HTML to PDF software doesn't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.