Codeigniter convert excel file to pdf

0 votes

How can I convert excel to pdf?

I want to put 5 excel files and after I click upload convert them to 1 pdf.

My code: 

    /**
 * Example: DOMPDF 
 *
 * Documentation: 
 * http://code.google.com/p/dompdf/wiki/Usage
 *
 */
public function index() {   
    // Load all views as normal
    $this->load->view('test');
    // Get output html
    $html = $this->output->get_output();

    // Load library
    $this->load->library('dompdf_gen');

    // Convert to PDF
    $this->dompdf->load_html($html);
    $this->dompdf->render();
    $this->dompdf->stream("welcome.pdf");

}

The library:

class Dompdf_gen {

public function __construct() {

    require_once APPPATH.'third_party/dompdf/dompdf_config.inc.php';

    $pdf = new DOMPDF();

    $CI =& get_instance();
    $CI->dompdf = $pdf;

}

}
Sep 26 in Others by Kithuzzz
• 20,660 points
187 views

1 answer to this question.

0 votes

This is a basic php script for converting Excel to PDF; you may use it and convert it to a subclass of CodeIgniter as well. To make PDF as you choose, you must first dump all Excel data into a PHP array or var. 

please check this URL:  PHP read excel file

answered Sep 27 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
1 answer

How to convert pdf file to excel file using python

Just specify your whole output path instead ...READ MORE

answered Nov 4 in Others by narikkadan
• 37,660 points
218 views
0 votes
1 answer

Convert JSON file to Excel File

Hi To convert a file, Set options and ...READ MORE

answered Feb 16 in Others by Edureka
• 13,640 points
380 views
0 votes
1 answer

Convert Excel and Word files to PDF Using ruby

 You can combine some: For excel files - ...READ MORE

answered Sep 26 in Others by narikkadan
• 37,660 points
145 views
0 votes
1 answer

Java Spring - Writing Excel file and converting to PDF

Since you are using Spring I suggest ...READ MORE

answered Sep 26 in Others by narikkadan
• 37,660 points
272 views
0 votes
1 answer

Converting excel to pdf using PHP

If utilizing PHP on a Windows PC, ...READ MORE

answered Oct 23 in Others by narikkadan
• 37,660 points
253 views
0 votes
1 answer

How to convert .xls to .pdf via PHP?

You can use PHPExcel to read the XLS ...READ MORE

answered Nov 8 in Others by narikkadan
• 37,660 points
78 views
0 votes
1 answer
0 votes
1 answer

CodeIgniter removing index.php from url

To solve your doubt, use the following ...READ MORE

answered Feb 23 in PHP by Aditya
• 7,660 points
239 views
0 votes
1 answer
0 votes
1 answer

How can I convert excel file to pdf using TCPDF?

PHPExcel can only read charts from Excel2007 ...READ MORE

answered Oct 21 in Others by narikkadan
• 37,660 points
145 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP