background-image
-
I’ve found this code to include a background-image :
class MYPDF extends TCPDF { public function Header() { $bMargin = $this->getBreakMargin(); $auto_page_break = $this->AutoPageBreak; $this->SetAutoPageBreak(false, 0); $img_file = K_PATH_IMAGES.'background.jpg'; $this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0); $this->SetAutoPageBreak($auto_page_break, $bMargin); $this->setPageMark(); } } $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
I’ve paste these lines into the wp-post-to-pdf.php file > function generate_pdf_file after the lines :
if(!class_exists('TCPDF')) { require_once(WPPT0PDF_PATH . '/tcpdf/tcpdf.php'); } if(!class_exists('simple_html_dom')) { require_once(WPPT0PDF_PATH . '/simplehtmldom/simple-html-dom.php');}
But then the script stops working.
I know alot of people want a background image for the generated PDF, could you please post an example ?Kind regards, Twan
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘background-image’ is closed to new replies.