panique / mini3

Just an extremely simple naked PHP application, useful for small projects and quick prototypes.
274 stars 100 forks source link

Generating PDFs with PHP mini #51

Closed johoehn closed 8 months ago

johoehn commented 5 years ago

I want to use dompdf, I installed it via composer. I did

use Dompdf\Dompdf;

in top of the Controller and used it like the example says:

    $dompdf = new Dompdf();
    $dompdf->loadHtml('hello world');
    $dompdf->setPaper('A4', 'landscape');
    $dompdf->render();
    $dompdf->stream();

The browser cannot open the pdf, the error occurs only in PHP Mini framework, I tried it in a separate project and it worked without problems. Do you have any ideas?

panique commented 5 years ago

Hi, do you have some kind of error message ?

johoehn commented 5 years ago

No, there is no error, the downloaded file is just 1KB and can't open.

LearningTools commented 5 years ago

Hello, I just did a test with the FPDF library and if you generate the pdf, you should try this other library, greetings. sorry for my bad English