creating pdf file using Codeigniter AJAX for html

1,269 views
Skip to first unread message

dinomycle

unread,
Jul 1, 2012, 3:18:13 AM7/1/12
to dompdf
hello all
i using the dompdf as said int he article.

http://codeigniter.com/wiki/PDF_generation_using_dompdf/

in my system, i am using AJAX method to show the html views. so when i
generate the pdf file, i do not get my view(HTML) files. I see the
message loading in the pdf file created.

I need help how can i use dompdf where my html page using AJAX method

the method i as using now is as below
$html_view = $this->load->view('sample_file',$data, true);
$this->load->helper(array('dompdf', 'file'));
dompdf_create($html_view, 'filename');

thanks for the support
dinomycle

BrianS

unread,
Jul 3, 2012, 1:23:50 PM7/3/12
to dom...@googlegroups.com
There are probably a few ways to do this. But it would help to know your goal. For example, do you want the PDF to display in the current page or is it ok to load a new page after the PDF loads.

Probably the easiest way to do this would be to render the file, save it to disk, send to the browser the file location, then redirect. I don't know how, in code igniter, you would retrieve the URL of the file after save, but I'm sure there's documentation on that.

Follow-up with more details on what you want to achieve and we can try to provide a more relevant solution
Reply all
Reply to author
Forward
0 new messages