Fix pdf export

pull/2487/head
jmontoyaa 9 years ago
parent 046564cbb0
commit 066f1e6093
  1. 12
      main/inc/lib/pdf.lib.php

@ -251,8 +251,7 @@ class PDF
//this is a chapter, print title & skip the rest //this is a chapter, print title & skip the rest
if ($print_title) { if ($print_title) {
$this->pdf->WriteHTML( $this->pdf->WriteHTML(
'<html><body><h3>'.$html_title.'</h3></body></html>'.$page_break, '<html><body><h3>'.$html_title.'</h3></body></html>'.$page_break
2
); );
} }
continue; continue;
@ -273,8 +272,7 @@ class PDF
//it's not a chapter but the file exists, print its title //it's not a chapter but the file exists, print its title
if ($print_title) { if ($print_title) {
$this->pdf->WriteHTML( $this->pdf->WriteHTML(
'<html><body><h3>' . $html_title . '</h3></body></html>', '<html><body><h3>' . $html_title . '</h3></body></html>'
2
); );
} }
@ -376,12 +374,12 @@ class PDF
$title = $filename; // Here file name is expected to contain ASCII symbols only. $title = $filename; // Here file name is expected to contain ASCII symbols only.
} }
if (!empty($document_html)) { if (!empty($document_html)) {
$this->pdf->WriteHTML($document_html.$page_break, 2); $this->pdf->WriteHTML($document_html.$page_break);
} }
} elseif (in_array($extension, array('jpg','jpeg','png','gif'))) { } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) {
//Images //Images
$image = Display::img($file); $image = Display::img($file);
$this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break, 2); $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break);
} }
} }
@ -495,7 +493,7 @@ class PDF
if (!empty($css)) { if (!empty($css)) {
$this->pdf->WriteHTML($css, 1); $this->pdf->WriteHTML($css, 1);
} }
$this->pdf->WriteHTML($document_html, 2); $this->pdf->WriteHTML($document_html);
if (empty($pdf_name)) { if (empty($pdf_name)) {
$output_file = 'pdf_'.date('Y-m-d-his').'.pdf'; $output_file = 'pdf_'.date('Y-m-d-his').'.pdf';

Loading…
Cancel
Save