Answer the question
In order to leave comments, you need to log in
Html to pdf, what do you recommend?
Hello!
In general, I need something that could translate html pages (invoices, checks, etc.) into pdf, I tried all the top libraries in https://packagist.org/?query=pdf , but nothing works.
mpdf / mpdf
dompdf / dompdf
spipu / html2pdf
they all throw out broken PDF pages, even if you write Hello World there, I have no idea what is wrong with them. What can you advise?
Answer the question
In order to leave comments, you need to log in
Something you are not doing.
<?php
require_once 'mPDF/vendor/autoload.php';
$mpdf = new mPDF('s','A4',8,'freesans',20,10,10,10);
$mpdf->WriteHTML('<html><head></head><body><h1>Hello, world!</h1></body></html>');
$mpdf->Output("hello_world.pdf", 'I');
We use libreoffice backend to generate pdf (web page in pdf).
Of course, you can also use headless chrome, but we haven't tested it yet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question