0

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!

fool-dev
  • 7,671
  • 9
  • 40
  • 54
  • 2
    We need more details than just this. An eg would be, adding your code that triggers this. Do not paste the whole website code, but create [mcve](https://stackoverflow.com/help/mcve) – Aniket Sahrawat Feb 09 '18 at 02:47
  • $this->db->select("pxtype,(casecode) as casecodex,patientname,concat(dischadate,' ',dischatime) as discha ,hmoname, (select sum(totalamt) FROM ". inpatient_ipd_vw ." where Start2 <> 'MI' and Start2 <> 'PD' and Start2 <> 'PF' and casecode = casecodex) as ACTUALHOSP, (select sum(totalamt) FROM ". inpatient_ipd_vw ." where Start4 = 'PDPP' and casecode = casecodex ) as PHICHOSP") – Alynna Pajaron Feb 09 '18 at 03:02
  • I have 6 nested select statements. When I tried to load a pdf for less than 10 rows, it works fine. But when I tried 300+ rows then that's the time it shows the error. – Alynna Pajaron Feb 09 '18 at 03:03

1 Answers1

0

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

Astound
  • 192
  • 12