get_option('wpsg_voucherproduct_width') > $this->get_option('wpsg_voucherproduct_height')) { $pageMode = 'L'; } else { $pageMode = 'P'; } $pdf = new wpsg_fpdf($pageMode, 'mm', array($this->get_option('wpsg_voucherproduct_width'), $this->get_option('wpsg_voucherproduct_height'))); $pdf->SetAutoPageBreak(true, 5); $pdf->AddPage(); foreach ($this->view['texte'] as $t) { if (($t['bg'] ?? '0') == '1' && ($t['aktiv'] ?? '0') == '1') { $t['text'] = $this->replaceUniversalPlatzhalter($t['text'], $this->view['order_id'], false, false, $this->view['product_id'], $this->view['customReplace'], $this->view['product_index']); $pdf->setAlpha((($t['alpha'] ?? '') === '') ? 1 : min(1, max(0, floatval(str_replace(',', '.', $t['alpha']))))); $pdf->wpsg_SetTextColor($t['color']); $pdf->SetFont('Arial', '', $t['fontsize']); $pdf->RotatedText( $t['x'], $t['y'], $t['text'], $t['angle'], $t['align'] ); $pdf->setAlpha(1); } } if (isset($this->view['bp_pdf']) && file_exists($this->view['bp_pdf'])) { $pagecount = $pdf->setSourceFile($this->view['bp_pdf']); $tplidx = $pdf->importPage(1, '/MediaBox'); $pdf->useTemplate($tplidx, 0, 0, $this->get_option('wpsg_voucherproduct_width'), $this->get_option('wpsg_voucherproduct_height')); } else if (isset($this->view['bp_jpg']) && file_exists($this->view['bp_jpg'])) { $pdf->image($this->view['bp_jpg'], 0, 0, $this->get_option('wpsg_voucherproduct_width'), $this->get_option('wpsg_voucherproduct_height'), 'jpg'); } foreach ($this->view['texte'] as $t) { // Hintergrundtexte sind oben schon gedruckt if (($t['aktiv'] ?? '0') == '1' && ($t['bg'] ?? '0') != '1') { $t['text'] = $this->replaceUniversalPlatzhalter($t['text'], $this->view['order_id'], false, false, $this->view['product_id'], $this->view['customReplace'], $this->view['product_index']); $pdf->setAlpha((($t['alpha'] ?? '') === '') ? 1 : min(1, max(0, floatval(str_replace(',', '.', $t['alpha']))))); $pdf->SetFont('Arial', '', $t['fontsize']); $pdf->wpsg_SetTextColor($t["color"]); $pdf->RotatedText( $t['x'], $t['y'], $t['text'], $t['angle'], $t['align'] ); $pdf->setAlpha(1); } } ob_end_clean(); if ($this->view['preview'] !== true) { $pdf->Output($this->view['filename'], 'F'); } else { $pdf->Output($this->view['filename'], 'I'); exit; } ?>