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, 2022 in Others by Kithuzzz
• 28,900 points
332 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, 2022 by narikkadan
• 53,520 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, 2022 in Others by narikkadan
• 53,520 points
1,093 views
0 votes
1 answer

Convert JSON file to Excel File

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

answered Feb 16, 2022 in Others by Edureka
• 13,630 points
474 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, 2022 in Others by narikkadan
• 53,520 points
287 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, 2022 in Others by narikkadan
• 53,520 points
568 views
0 votes
1 answer

Converting excel to pdf using PHP

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

answered Oct 23, 2022 in Others by narikkadan
• 53,520 points
836 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, 2022 in Others by narikkadan
• 53,520 points
214 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, 2022 in PHP by Aditya
• 7,660 points
347 views
0 votes
1 answer

How can I convert excel to PDF by Libreoffice and keep all format from excel file?

"Times New Roman" typeface does not have ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 53,520 points
466 views
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, 2022 in Others by narikkadan
• 53,520 points
342 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