'TCPDF',   'Location' => 'Office',   'Reason' => 'Testing TCPDF',   'ContactInfo' => 'http://www.tcpdf.org', ); $pdf->setSignature($…" name="description"> 'TCPDF',   'Location' => 'Office',   'Reason' => 'Testing TCPDF',   'ContactInfo' => 'http://www.tcpdf.org', ); $pdf->setSignature($…" property="og:description">

Blog : Digitally sign PDF document

 Digitally sign PDF document
I try to add this code:

PHP Code:
$certificate="file:///data/web/virtuals/dev.smarthost.cz/secure/smarthost.crt";
$info = array(
  'Name' => 'TCPDF',
  'Location' => 'Office',
  'Reason' => 'Testing TCPDF',
  'ContactInfo' => 'http://www.tcpdf.org',
);

$pdf->setSignature($certificate,$certificate,'','',2,$info);  
to invoicepdf.tpl in my template direcory, but document is still unsigned.

What I do wrong?  Reply With Quote .
--------------------------------------------------------------------------------
05-20-11, 12:06 AM #2 MH-Stefan
View Profile View Forum Posts
 
Member
 Join Date:Dec 2008
Posts:32
Sorry for resurrecting an old thread, but since the TCPDF library has been updated with v4.5, I assume that digitally signing invoices should now be possible (somehow). Unfortunately, the code above still doesn't work.

Any suggestions would be greatly appreciated. Most EU-based companies are legally required to digitally sign invoices, so this function is quite important.  Reply With Quote .
--------------------------------------------------------------------------------
05-25-11, 06:03 PM #3 xuser
View Profile View Forum Posts
 
Member
 Join Date:Nov 2007
Posts:49
Matt, One of my client's also reported the same issue. Following is his ticket that he raised with me.

~~~~~~~~~~~~
when i login to my client area to charge my account with Paypal ( in "Add Fund" section ) ,i see the folowing error message :
" TCPDF ERROR: Could not include font definition file: custom "
so i cant charge my account when i recieve this error.
~~~~~~~~~~
Last edited by xuser; 05-25-11 at 06:05 PM. ̣
█ ̣Real Value Hosting - Every day hosting solutions since 2003.
≡̣ Shared Hosting ̣≡̣ Reseller Hosting ̣≡̣ VPS ̣≡̣ Dedicated Servers ̣≡̣ True 24 x 7 x 365 Support Ì£  Reply With Quote .
--------------------------------------------------------------------------------
05-25-11, 06:05 PM #4 xuser
View Profile View Forum Posts
 
Member
 Join Date:Nov 2007
Posts:49
and some cron jobs are also giving this error message:

~~~~~~~~~~~~~~~~~
Cron <username@congo> php -q /home/username/public_html/billing/admin/cron.php
<strong>TCPDF ERROR: </strong>Could not include font definition file: custom
~~~~~~~~~~~~~~~~~ ̣
█ ̣Real Value Hosting - Every day hosting solutions since 2003.
≡̣ Shared Hosting ̣≡̣ Reseller Hosting ̣≡̣ VPS ̣≡̣ Dedicated Servers ̣≡̣ True 24 x 7 x 365 Support Ì£  Reply With Quote .
--------------------------------------------------------------------------------
06-15-11, 08:10 AM #5 ahosting
View Profile View Forum Posts
 
Registered User
 Join Date:Dec 2008
Posts:3
Try change Setup> General settings > Invoices - TCPDF Font Family from custom to Helvetica  Reply With Quote .
--------------------------------------------------------------------------------
10-03-11, 10:35 PM #6 drtduarte
View Profile View Forum Posts
 
Member
 Join Date:Nov 2007
Posts:111
Were you guys able to configure the digital signature?  Reply With Quote .
--------------------------------------------------------------------------------
12-08-11, 01:50 PM #7 stormy
View Profile View Forum Posts
 
Member
 Join Date:Nov 2008
Posts:299
I'm very interested in this as well. We are getting away with regular PDF invoices, but pretty soon the taxman is going to be asking us to do this. It's the law, after all!  Reply With Quote .
--------------------------------------------------------------------------------
12-08-11, 02:25 PM #8 laszlof
View Profile View Forum Posts Visit Homepage
 
Member
 Join Date:Feb 2009
Location:Atlanta, GA
Posts:1,680
Seems to work fine in my tests. Heres the code I added to invoicepdf.tpl


Code:
// Sign PDF
$certificate = 'file://'.ROOTDIR.'/test.crt';
$info = array(
  'Name' => 'Test',
  'Location' => 'Test',
  'Reason' => 'Signing Invoice',
  'ContactInfo' => 'Test');
$pdf->setSignature($certificate, $certificate, $info);The certificate contains both the private key and certificate, thats why its defined twice in the setSignature() function. More info on what needs to be passed to setSignature() can be found here:

http://www.tcpdf.org/doc/classTCPDF....d368628bceeb75 Frank Laszlo
Developer - Franksworld Solutions, LLC
Modules: ServerUptime|UnBlockMe|Admin IP Whitelist|Regional Promotions|Affiliate Coupons|GoogleApps|Signed Invoices|Samurai Payment Gateway|Twilio Call-Redirect  Reply With Quote .
--------------------------------------------------------------------------------
12-09-11, 03:15 PM #9 stormy
View Profile View Forum Posts
 
Member
 Join Date:Nov 2008
Posts:299
Ok, that's way above my head. Last time I looked it wasn't even possible to sign invoices digitally. Now that it is, I hope someone can put together a module to do it. I'm going to put in a request in the appropriate subforum  Reply With Quote .
--------------------------------------------------------------------------------
12-11-11, 02:22 AM #10 laszlof
View Profile View Forum Posts Visit Homepage
 
Member
 Join Date:Feb 2009
Location:Atlanta, GA
Posts:1,680
Here ya go:

http://forum.whmcs.com/showthread.php?p=207966