tcpdf

Is this pdf digital signed correctly? PHP/TCPDF

别等时光非礼了梦想. 提交于 2019-12-02 00:42:13
I'm updating a project for my company and there is a section where we need to digitally sign a pdf with our certificate file. In this case, I should change the script that signs this pdf using an updated library from PHP. In the old code, we were using another script to make happen that, and we had to use a .p12 file + a string. Using this old script, when you open the created pdf with Acrobat Reader DC we get the next image where you can see that says "Signed and all signatures are valid". In the new script, I'm using the next example: https://tcpdf.org/examples/example_052/ To be able to

codeigniter send pdf file as email attachment

半世苍凉 提交于 2019-12-01 23:08:16
I am generating pdf files on fly using TCPDF . By using TCPDF i am getting raw file with base64 encoded now i want to send this raw data as email attachment using codeigniter email helper function. How can do this? Took my a while to find the answer, hope it helps anyone in the future: // Get email address and base64 via ajax $email = $this->input->post('email'); $base64 = $this->input->post('base64'); $base64 = str_replace('data:application/pdf;base64,', '', $base64); $base64 = str_replace(' ', '+', $base64); $data = base64_decode($base64); // Locally emails do now work, so I use this to

How to download PDF File Generated from TCPDF (PHP) using AJAX (jQuery)?

我的梦境 提交于 2019-12-01 17:37:12
I am using Yii Framework, TCPDF and jQuery to generate a pdf. The pdf is generated by inputing in a form and submitting it using ajax. The pdf is created but here is the problem when it returns to the client, it down not download. here is the php code $pdf->Output('Folder Label.pdf','D'); the jQuery on success function has success: function(data) { window.open(data); } Which i got from this site. Can you please help If the problem is that you are not getting the browser's download dialog for the PDF, then the solution is to do it this way: First, redirect the browser (using window.location as

How to download PDF File Generated from TCPDF (PHP) using AJAX (jQuery)?

怎甘沉沦 提交于 2019-12-01 17:05:10
问题 I am using Yii Framework, TCPDF and jQuery to generate a pdf. The pdf is generated by inputing in a form and submitting it using ajax. The pdf is created but here is the problem when it returns to the client, it down not download. here is the php code $pdf->Output('Folder Label.pdf','D'); the jQuery on success function has success: function(data) { window.open(data); } Which i got from this site. Can you please help 回答1: If the problem is that you are not getting the browser's download dialog

In TCPDF, this getAliasNbPages return value {:ptp:} so How can i get integer

别说谁变了你拦得住时间么 提交于 2019-12-01 14:03:52
In TCPDF vthis function show value {:ptp:} so How can i get interger. So please help me. I need this value because i need apply some condition. I have lot of checked documentation. But i can't found the solution. You only can get an alias because you not know the total page number until the end of the document. TCPDF replace the placeholder alias at $pdf->Output() with the correct number. 来源: https://stackoverflow.com/questions/51761325/in-tcpdf-this-getaliasnbpages-return-value-ptp-so-how-can-i-get-integer

Is this pdf digital signed correctly? PHP/TCPDF

泪湿孤枕 提交于 2019-12-01 06:41:59
问题 I'm updating a project for my company and there is a section where we need to digitally sign a pdf with our certificate file. In this case, I should change the script that signs this pdf using an updated library from PHP. In the old code, we were using another script to make happen that, and we had to use a .p12 file + a string. Using this old script, when you open the created pdf with Acrobat Reader DC we get the next image where you can see that says "Signed and all signatures are valid".

Warning: openssl_pkcs7_sign(): error getting private key using WAMP

浪尽此生 提交于 2019-12-01 06:29:17
I am trying to sign PDF using TCPDF, but I have got this error: Warning: openssl_pkcs7_sign(): error getting private key in C:\wamp\www\tcpdf\tcpdf.php on line 7594. My PHP version is 5.5.12 and TCPDF 6.2.11. Windows 7. Other examples run well but this fails. I have tried: 'file://'.( dirname(FILE)).'./path/to/file' and again $certificate = 'file://'.realpath('../tcpdf.crt'); but does not work for me. I think file:// is not correct. You fetch die real path with dirname(__FILE__) that should be enough. So i prefer: $certificate = __DIR__'/../tcpdf.crt'; __DIR__ or dirname(FILE) is the path to

How do you add custom fonts in TCPDF?

喜你入骨 提交于 2019-12-01 04:44:31
I would like to add a custom font to a pdf I'm generating using TCPDF. I might be missing something but the docs seem to be out dated. They are referencing the addTTFfont() function but I think it's been deprecated and no longer exists in the latest version of TCPDF. I read that I need to convert the ttf file and put it in the fonts folder so I ran: php/tcpdf/tools/tcpdf_addfont.php -i php/font/rumpelstiltskin-webfont.ttf and it generated these files which are now in the fonts folder: rumpelstiltskinwebfont.ctg.z rumpelstiltskinwebfont.z rumpelstiltskinwebfont.php Then I tried to add the font:

Warning: openssl_pkcs7_sign(): error getting private key using WAMP

≡放荡痞女 提交于 2019-12-01 04:27:38
问题 I am trying to sign PDF using TCPDF, but I have got this error: Warning: openssl_pkcs7_sign(): error getting private key in C:\wamp\www\tcpdf\tcpdf.php on line 7594. My PHP version is 5.5.12 and TCPDF 6.2.11. Windows 7. Other examples run well but this fails. I have tried: 'file://'.( dirname(FILE)).'./path/to/file' and again $certificate = 'file://'.realpath('../tcpdf.crt'); but does not work for me. 回答1: I think file:// is not correct. You fetch die real path with dirname(__FILE__) that

Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\\xampp\\htdocs\\this\\tcpdf\\tcpdf.php on line 8366

こ雲淡風輕ζ 提交于 2019-12-01 03:58:50
I am using TCPDF to sign PDF, but when running the example 52 I got this error: Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366 Could you please tell me or guide me where is the problem. I am just running the example without changing anything. I am using xampp. The problem is with the location from where it tries to access the private key. Instead of '' like in their example use 'file://'.( dirname( FILE )).'./path/to/file'. This worked for me. I solved it by using: $certificate = 'file://'.realpath('..