public function get_output() { if ($this->output) { return $this->output; } $this->append_footers(); $this->output = Libs_TCPDFCommon::output($this->pdf); $this->content_length = strlen($this->output); return $this->output; }
$end = $total; $limit_info = __('Records %s to %s of %s', array($start, $end, $total)) . "\n"; } $tcpdf = Libs_TCPDFCommon::new_pdf(); $filters = implode(' ',Utils_RecordBrowserCommon::crits_to_words($tab, $crits)); $filters = strip_tags($filters); $filters = str_replace(' ', ' ', $filters); $filters = str_replace(' and ', "\n", $filters); $filters = str_replace(' is equal to', ':', $filters); $subject = $limit_info . $filters; Libs_TCPDFCommon::prepare_header($tcpdf, _V(DB::GetOne('SELECT caption FROM recordbrowser_table_properties WHERE tab=%s', array($tab))), $subject, false); Libs_TCPDFCommon::add_page($tcpdf); Libs_TCPDFCommon::SetFont($tcpdf, Libs_TCPDFCommon::$default_font, '', 6); $html = Libs_TCPDFCommon::stripHTML(str_replace(array('<br>',' '),array('<br/>',' '),$html)); Libs_TCPDFCommon::writeHTML($tcpdf, $html, false); $buffer = Libs_TCPDFCommon::output($tcpdf); header('Content-Type: application/pdf'); header('Content-Length: '.strlen($buffer)); header('Content-disposition: inline; filename="recordset_'.$tab.'.pdf"'); print($buffer); ?>
public function display_pdf_row($grow) { if (empty($grow)) { return; } static $first_row; if (!isset($first_row)) { $first_row = true; } $table = ''; foreach ($grow as $row) { $theme = $this->init_module(Base_Theme::module_name()); $theme->assign('row', $row); $theme->assign('params', array('widths' => $this->widths, 'height' => $this->height)); ob_start(); $theme->display('pdf_row'); $table .= ob_get_clean(); } $table = Libs_TCPDFCommon::stripHTML($table); $pages = $this->pdf_ob->getNumPages(); $tmppdf = clone $this->pdf_ob->tcpdf; $tmppdf->WriteHTML($table, false, 0, false); if ($pages == $tmppdf->getNumPages() || $first_row) { $this->pdf_ob->writeHTML($table, false); $first_row = false; return; } $this->pdf_ob->AddPage(); $this->display_pdf_header(); $this->pdf_ob->writeHTML($table, false); }
public static function writeHTML(& $tcpdf, $html, $autobreak=true) { $html = Libs_TCPDFCommon::stripHTML($html); if ($autobreak) { $pages = $tcpdf->getNumPages(); $tmppdf = clone($tcpdf); $tcpdf->WriteHTML($html,false,0,false); if ($pages!=$tcpdf->getNumPages()) { $tcpdf = $tmppdf; $tcpdf->AddPage(); $tcpdf->WriteHTML($html,false,0,false); } } else $tcpdf->WriteHTML($html,false,0,false); }
public function upload_logo($file, $oryg, $data) { $fp = fopen($file, "r"); $ext = strrchr($oryg, '.'); if ($ext === '' || $ext !== '.png') { print __('Invalid extension. Only *.png is allowed.', array(), false); return; } $target_filename = Libs_TCPDFCommon::get_logo_filename(); if (file_exists($target_filename)) { unlink($target_filename); } copy($file, $target_filename); print __('Upload successful.', array(), false); }