tcpdf

TCPDF and base64 image

夙愿已清 提交于 2021-02-11 15:24:57
问题 Good Afternoon, I have a problem with insert an image in a PDF document with TCPDF lib. The image is caught from JSignature in this manner: $uri=base64_decode($_POST['firma']); $filename=SIGNATURE_IMAGE_PATH.ucfirst(strtolower(($_POST['cognome']))).ucfirst(strtolower(($_POST['nome'])))."-".$birthday.".png"; $ret=file_put_contents($filename, $uri); In another PHP page I can view image correctly in this manner: <?php $string=base64_encode(file_get_contents(str_replace(" ", "", SIGNATURE_IMAGE

Is there any configurations required to show telugu unicode fonts in tcpdf?

会有一股神秘感。 提交于 2021-02-11 06:31:26
问题 I have to generate a PDF from php page contains html which includes unicode fonts (Telugu). Its showing perfectly when I print html code and while rendering to PDF using TCPDF, the unicode characters are distorting of letter formations. I have copied the telugu font from google translators and added a telugu font into tcpdf lib. $message = '<h2 align="center">ధన్యవాదములు -- శుభోదయం</h2>'; $fontname = $pdf->addTTFfont('E:\xampp\htdocs\ncs\svdn\flowers\tcpdf\fonts\mandali-regular.ttf',

Verify signed PDF Document in PHP

我怕爱的太早我们不能终老 提交于 2021-02-07 03:44:26
问题 I have a signed PDF document. It was signed by using TCPDF. Now I want to verify it. This is my solution: Get content of signed pdf. Get original content and signature value base on /ByRange field. Get encrypted digest message from signature value. It's octet string at the end of signature value. Use Openssl_public_decrypt() function to decrypt the encrypted digest message with public key. Then we have a string which has a prefix ("3021300906052b0e03021a05000414"). This prefix denotes the

Verify signed PDF Document in PHP

一世执手 提交于 2021-02-07 03:41:44
问题 I have a signed PDF document. It was signed by using TCPDF. Now I want to verify it. This is my solution: Get content of signed pdf. Get original content and signature value base on /ByRange field. Get encrypted digest message from signature value. It's octet string at the end of signature value. Use Openssl_public_decrypt() function to decrypt the encrypted digest message with public key. Then we have a string which has a prefix ("3021300906052b0e03021a05000414"). This prefix denotes the

Split PDF into chunks by page range in Php

爱⌒轻易说出口 提交于 2021-02-05 09:40:59
问题 so after browsing through many packages like TCPDF, FPDP, DOM2PDF and many other excellent php pdf packages, I couldn't find this feature in any packages where it allows to split the pdf file by page range. for example I want to split the pdf from page 20-100 or 30-50. or create a pdf from a pdf ranging from page 20-100. so is there any library that has this feature ? 回答1: PDFMerger has this functionality, and I personally enjoy its simplicity. $pdf = new PDFMerger; $pdf->addPDF('pdf1.pdf',

Split PDF into chunks by page range in Php

自闭症网瘾萝莉.ら 提交于 2021-02-05 09:40:02
问题 so after browsing through many packages like TCPDF, FPDP, DOM2PDF and many other excellent php pdf packages, I couldn't find this feature in any packages where it allows to split the pdf file by page range. for example I want to split the pdf from page 20-100 or 30-50. or create a pdf from a pdf ranging from page 20-100. so is there any library that has this feature ? 回答1: PDFMerger has this functionality, and I personally enjoy its simplicity. $pdf = new PDFMerger; $pdf->addPDF('pdf1.pdf',

How to configure tcpdf when installing with Composer?

非 Y 不嫁゛ 提交于 2021-01-27 12:31:03
问题 Our legacy PHP code includes tcpdf (https://github.com/tecnickcom/TCPDF) as part of the code base. I am trying to move it out to a vendor folder, so I added Composer to the project, added TCPDF to composer.json and updated. But the config/tcpdf_config.php file is modified in our code base (custom PDF author name etc.), and rightfully so, according to the docs: http://www.tcpdf.org/installation.php Now, I'm not sure it's a good idea to modify vendor/tecnick.com/tcpdf/config/tcpdf_config.php

Send TCPDF generated pdf with phpmailer

心不动则不痛 提交于 2020-06-23 08:28:26
问题 I am generating a pdf file on the fly without saving it to the disk with: $attachment = $this->pdf->Output('e-tickets.pdf', 'S'); According to TCPDF this should return a string containing the pdf file. But sending it with PHPMailer results in a corrupt file: $mail->AddStringAttachment($attachment, 'e-tickets.pdf', 'base64', 'application/pdf'); I tried the following alternatives (and all possible combinations): $attachment = $this->pdf->Output('e-tickets.pdf', 'E'); $mail->AddStringAttachment(