FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PDF certificate
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PDF certificate [message #175535] Wed, 05 October 2011 04:31 Go to next message
bob is currently offline  bob
Messages: 11
Registered: February 2011
Karma: 0
Junior Member
I need to write a PHP script that e-mails a PDF certificate (not
cryptography… just a congrats cert) to someone. The certificate
needs to have the person's name and address on it, so the PHP script
must modify the PDF. Any ideas on how to do this?
Re: PDF certificate [message #175536 is a reply to message #175535] Wed, 05 October 2011 09:58 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
On 10/5/2011 6:31 AM, bob wrote:
> I need to write a PHP script that e-mails a PDF certificate (not
> cryptography… just a congrats cert) to someone. The certificate
> needs to have the person's name and address on it, so the PHP script
> must modify the PDF. Any ideas on how to do this?
>

Start reading here:
http://nl.php.net/manual/en/book.pdf.php

Good luck!

Regards,
Erwin Moller



--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: PDF certificate [message #175537 is a reply to message #175535] Wed, 05 October 2011 14:03 Go to previous message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma: 0
Member
On Tue, 4 Oct 2011 21:31:59 -0700 (PDT), in comp.lang.php bob
<bob(at)coolgroups(dot)com>
<65431589-b803-4bff-9946-0dae668058cd(at)j1g2000yqj(dot)googlegroups(dot)com>
wrote:

> | I need to write a PHP script that e-mails a PDF certificate (not
> | cryptography… just a congrats cert) to someone. The certificate
> | needs to have the person's name and address on it, so the PHP script
> | must modify the PDF. Any ideas on how to do this?

I use tcpdf (http://www.tcpdf.org).
To save yourself a lot of work; create an image of your certificate.
You can use this as a background for the PDF page.

require_once('tcpdf/tcpdf.php');
class myPDF extends TCPDF {
//---- set custom header and footer
public function Footer() {}
}
$pdf = new myPDF('L','mm','LETTER');
$pdf->SetAuthor("...");
$pdf->SetCreator("..");
$pdf->SetTitle("...");
$pdf->SetSubject("....");
$pdf->SetKeywords("...");
//--- set the margins to zero
$pdf->SetMargins(0,0,0,true);
$pdf->SetAutoPageBreak(false, PDF_MARGIN_BOTTOM);
//--- use an image for the background
$pdf->Image("images/cert1.gif", 0, 0, 279.25, 215.5, 'gif');
//--- position and output custom text
$pdf->SetFont('Helvetica','B',24);
$pdf->SetXY( 35, 21 ); $pdf->Cell(130, 0, $sName, 0, 0, 'L');
....
....
//--- output the page
$pdf->Output("results/pdf/".$code.".pdf", "F");
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: anti aging skin products
Next Topic: Secure cookies prevent login in PHP/Zend
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 22:10:04 GMT 2024

Total time taken to generate the page: 0.02567 seconds