spipu / html2pdf

OFFICIAL PROJECT | HTML to PDF converter written in PHP
http://html2pdf.fr/en/default
Open Software License 3.0
1.68k stars 749 forks source link

html2pdf works only in my localhost, NOT in a server #570

Open vicentblai opened 4 years ago

vicentblai commented 4 years ago

I'm trying to create a pdf in my server but does not work, but in local server works...

Thec ode is simple, I´m starting and I only want to check if the pdf is created before starting with css and collect the rest of form data.

I have the pdf content in a file called: print_view.php This is the code in php form

<?php require 'vendor/autoload.php'; use Spipu\Html2Pdf\Html2Pdf;

if (isset($_POST['crear'])){
//cokkect the content of the pdf ob_start(); require 'print_view.php'; $html=ob_get_clean(); $html2pdf=new Html2Pdf('P','A4','es','true','UTF-8'); $html2pdf->writeHTML($html); ob_end_clean();

$html2pdf->writeHTML($html); $html2pdf->output('factura_proforma_Papeleria_Molina.pdf'); } . . . .

In the print_view.php the code is:

This works in my localhost with xampp perfectly, but once is uploaded to my internet server the page do not charge the pdf. Please, any suggestion? tks
romain-neil commented 4 years ago

If html2pdf work in local, then its not related to html2pdf, but to the server configuration.