tcpdf

How to call tcpdf non-static method in tpl file

蓝咒 提交于 2020-06-17 14:03:08
问题 I have a problem generating Barcode in Delivery Slip template in Prestashop 1.7.6.x (or just 1.7) with the same template i was using in Prestashop 1.6 when i call the method via it give me error Using "$this when not in object context" this is the stack trace via Symfony debugger Symfony\Component\Debug\Exception\FatalThrowableError: Using $this when not in object context at vendor/tecnickcom/tcpdf/tcpdf.php:17060 at TCPDF::serializeTCPDFtagParameters(array('6856616461MA', 'C39', '70.2', '34

TCPDF convert inline SVG with html into PDF

二次信任 提交于 2020-05-29 17:18:27
问题 I am using TCPDF to convert html into PDF. $pdf = new TCPDF(); $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->AddPage(); $html = '<div>Some random html </div>'; $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output('/pdf/output.pdf','F'); It works like a charm. But I have a case when (Dynamic) html has SVG inline code also. So I need to convert this html which has SVG into PDF. But it does not work. Below is my code. $pdf = new TCPDF(); $pdf->SetPrintHeader(false

openssl_pkcs7_sign(): error getting private key

喜你入骨 提交于 2020-05-27 18:36:10
问题 When trying to use TCPDF to generate a pdf and sign it, i get the error: openssl_pkcs7_sign(): error getting private key. and: Undefined offset: 1 in ..\tcpdf\tcpdf.php on line 7604 I have found the following stackoverflow posts and tried to follow their solutions: Warning: openssl_pkcs7_sign(): error getting private key using WAMP Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366 Unfortunately, nothing

openssl_pkcs7_sign(): error getting private key

自古美人都是妖i 提交于 2020-05-27 18:35:32
问题 When trying to use TCPDF to generate a pdf and sign it, i get the error: openssl_pkcs7_sign(): error getting private key. and: Undefined offset: 1 in ..\tcpdf\tcpdf.php on line 7604 I have found the following stackoverflow posts and tried to follow their solutions: Warning: openssl_pkcs7_sign(): error getting private key using WAMP Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366 Unfortunately, nothing

openssl_pkcs7_sign(): error getting private key

冷暖自知 提交于 2020-05-27 18:34:12
问题 When trying to use TCPDF to generate a pdf and sign it, i get the error: openssl_pkcs7_sign(): error getting private key. and: Undefined offset: 1 in ..\tcpdf\tcpdf.php on line 7604 I have found the following stackoverflow posts and tried to follow their solutions: Warning: openssl_pkcs7_sign(): error getting private key using WAMP Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366 Unfortunately, nothing

Creating multiple pages of PDF using android.graphics.pdf

和自甴很熟 提交于 2020-05-14 14:43:04
问题 I am trying to create an PDF using android.graphics.pdf. My issue is with multiple pages. I can give android.graphics.pdf html which could be then printed to a PDF. Now that doesn't work if text overflows the set page size. Is it possible to give it all the html and it would create multiple pages according to the content with respect to the page size? As does TCPDF :) Note. I am trying to avoid creating separate multiple pages by calculating the height of the content. 回答1: For this you'll

TCPDF returning weird characters

不羁的心 提交于 2020-02-24 12:28:28
问题 maybe you can help me. When I try to show a pdf I created I got some weird symbols like this u\>�'���O���r>c!%�@�R�`YPd+��vv����1��E�'^k-�WD�*+��W^��wy��V Z��dUdJ�B���C�ڳtK����j:c���5����50���D3lgH#�}%���D+������ix����,��-�'\�� �_st^&0�Y���������v�*Ӗ,W����u!H��sNN��0cӝ��`xEk��d��^� �8K9�BL����9�̋"6/�E�|�̛�-�7�P��B�#�T�F���4`���� What I do is transform a html file with this code $html = $this->load->view('ReporteIngresoView', $data, TRUE); $pdf = new Pdf('P', 'mm', 'A4', TRUE, 'UTF-8', FALSE);

TCPDF returning weird characters

浪尽此生 提交于 2020-02-24 12:28:14
问题 maybe you can help me. When I try to show a pdf I created I got some weird symbols like this u\>�'���O���r>c!%�@�R�`YPd+��vv����1��E�'^k-�WD�*+��W^��wy��V Z��dUdJ�B���C�ڳtK����j:c���5����50���D3lgH#�}%���D+������ix����,��-�'\�� �_st^&0�Y���������v�*Ӗ,W����u!H��sNN��0cӝ��`xEk��d��^� �8K9�BL����9�̋"6/�E�|�̛�-�7�P��B�#�T�F���4`���� What I do is transform a html file with this code $html = $this->load->view('ReporteIngresoView', $data, TRUE); $pdf = new Pdf('P', 'mm', 'A4', TRUE, 'UTF-8', FALSE);

tcpdf edit footer

家住魔仙堡 提交于 2020-01-29 03:48:20
问题 How do I edit a footer using tcpdf? I want to add current date & time at the footer. Please help. 回答1: Override the class like this : class MYPDF extends TCPDF { public function Footer() { $image_file = "img/bg_bottom_releve.jpg"; $this->Image($image_file, 11, 241, 189, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); $this->SetY(-15); $this->SetFont('helvetica', 'N', 6); $this->Cell(0, 5, date("m/d/Y H\hi:s"), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } then

TCPDF watermark images work only on first few pages of output PDF

青春壹個敷衍的年華 提交于 2020-01-24 00:32:08
问题 I am extending the TCPDF library to add a Header function which includes a watermark image. class PdfWrapperDraft extends PdfWrapper { // TODO: Rename to PdfWrapperWatermark and allow any watermark, not just the DRAFT image. public function Header() { // get the current page break margin $bMargin = $this->getBreakMargin(); // get current auto-page-break mode $auto_page_break = $this->AutoPageBreak; // disable auto-page-break $this->SetAutoPageBreak(false, 0); // set background image: in