D
D
DYLAN2019-02-05 14:17:43
HTML
DYLAN, 2019-02-05 14:17:43

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

2 answer(s)
R
Rsa97, 2019-02-05
@Rsa97

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');

https://www.dropbox.com/s/f1os5qjit1y49rm/hello_wo...

A
Andrey Nikolaev, 2019-02-05
@gromdron

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 question

Ask a Question

731 491 924 answers to any question