Issue with HTML2PDF, not rendering PDF
Asked Answered
Z

2

1

For some reason the HTML2PDF/TCPDF is not rendering the PDF... and I have no idea why... :S

render.php (main file)

form.php

(The links will lead you to the code im trying to use, so you can test it, you will only need the HTML2PDF Class)

can somebody tell me why the form isn't rendering??? I'm freaking out!!!

thanx in advance!!

Zolnay answered 4/4, 2012 at 18:43 Comment(2)
Any particular error you encountered?Feil
the funny thing is that there is no error catch from the class and neither from php or apache. thats the thing that's freaking me out. I also should point that this is the first time I used HTML2PDF or any PDF generation class, so I hope somebody has a clue...Zolnay
Z
2

The answer was the execution time.

Solved it by using the set_time_limit() function.

Zolnay answered 5/4, 2012 at 13:34 Comment(0)
N
0

Check the webserver logs for any html2pdf-related errors. If you're using apache, command will look like this:

tail -f -n 500 /var/log/apache2/error.log

Updated my answer since if pdf gets rendered but is empty, it's not a permission issue.

Neuralgia answered 4/4, 2012 at 18:51 Comment(7)
BluesRockAddict, have you checked the files, There is no problem with the permissions, when I take out the HTML/form it renders the pdf (empty)Zolnay
$html2pdf->writeHTML($content, isset($_GET['vuehtml'])); - looks like the correct name is WriteHTML (i.e. with capital W).Neuralgia
I changed it but it didnt make any change. :SZolnay
no, thats freaking strange... no errors of any kind, just wont render.Zolnay
What happens if you do $html2pdf->WriteHTML("<html><body><p>Test</p></body></html>")? Do you get "Test" in pdf or is it still empty?Neuralgia
HTML2PDF class auto generates the html and body tags, i tried small structures and its all ok, the problem is when I try to load "heavy" formsZolnay
Quick google search indicated that html2pdf doesn't work well with complex html documents, you might want to try using fpdf/mpdf instead.Neuralgia

© 2022 - 2024 — McMap. All rights reserved.