简体   繁体   中英

Failed to load PDF document in php using DOMPDF

My pdf is having 300+ rows. When I tried to load the PDF on my local server, it worked fine. But when I tried to load the PDF on my live server, it showed "Failed to load PDF document". I'm using DOMPDF and codeigniter .

Can you help me, please?

Thanks!

if it is working properly in local server, then it also work on live server.

When you are working on live server, it has request time out duration, if the DOMPDF not giving response within time then you show that page.

you need to put the php.ini on the server and in php.ini you have to change this

upload_max_filesize = 2M ;or whatever size you want

max_execution_time = 60 ; also, higher if you must - sets the maximum time in seconds

use -1 for the infinite time, you can set time whatever your pdf files takes to generate output.

To check and setup php.ini on your server here is your reference Dude, where's my php.ini?

Another option is genrate html and put it in view and print that file, that is the fastest and easy way to do it.

check this https://scotch.io/@nagasaiaytha/generate-pdf-from-html-using-jquery-and-jspdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM