php - Codeigniter - TCPDF ERROR: Unable to create output file -
i developing 1 system codeigniter. want generate purchase order in pdf , save in folder. so, use tcpdf library generating pdf. received following error.
**tcpdf error: unable create output file: http://localhost/new-esup/po/14-22-25-04-2015.pdf**
i used following code.
<?php tcpdf(); $obj_pdf = new tcpdf('p', pdf_unit, pdf_page_format, true, 'utf-8', false); $obj_pdf->setcreator(pdf_creator); $title = ""; $obj_pdf->settitle($title); $obj_pdf->setheaderdata('', '', $title, pdf_header_string); $obj_pdf->setheaderfont(array(pdf_font_name_main, '', pdf_font_size_main)); $obj_pdf->setfooterfont(array(pdf_font_name_data, '', pdf_font_size_data)); $obj_pdf->setdefaultmonospacedfont('helvetica'); //$obj_pdf->setheadermargin(pdf_margin_header); $obj_pdf->setfootermargin(pdf_margin_footer); $obj_pdf->setmargins(pdf_margin_left, '5', pdf_margin_right); $obj_pdf->setprintheader(false); $obj_pdf->setprintfooter(false); $obj_pdf->setautopagebreak(true, pdf_margin_bottom); $obj_pdf->setfont('helvetica', '', 12); $obj_pdf->setfontsubsetting(false); $obj_pdf->addpage(); $content = 'html text' $obj_pdf->writehtml($content, true, false, true, false, ''); $path = base_url() . 'po/'; $file_name = $rfq_row->rfq_id . '-' . $quote_row->quote_id . '-' . date('d-m-y') . '.pdf'; $full_path = $path . $file_name; ob_clean(); $obj_pdf->output($full_path, 'f'); ?>
can me. waste lots of time solve error.
delete condition 'if statement..' in static function under tcpdf_static.php, work's !!
public static function fopenlocal($filename, $mode) { /*if (strpos($filename, '://') === false) { $filename = 'file://'.$filename; } elseif (strpos($filename, 'file://') !== 0) { return false; }*/ return fopen($filename, $mode); }
Comments
Post a Comment