Good everyone, this is my first entry into soy_informático and I hope you like it or at least it helps someone. First thank geek to let me join his blog, I hope you will not regret ...
To generate dynamic PDFs are 2 ways PHP (if anyone knows more ways to be welcome): 1 st
Using PHP extensionPDF Lib is required for payment and installation (and if you're not the administrator of your hosting server and you can expect).
2 ° using the library class.ezpdf.php and some of its extensions such as class.backgroundpdf.php, which are free and require no installation (just download the library and upload to the server).
The second option takes a little longer to process pdfs, but it is much easier to use and make a point. For just one example. dynamic PDF image of corporate logo in the center:
1
2
'class.ezpdf.php'
); 3
include(
'class.backgroundpdf.php'
);
4 5
$pdf = new backgroundPDF ( 'a4'
, 'portrait' ,
'image' , array(
'img' => 'logo.jpg' , 'width' => 560 , 'height' => 420 , 'xpos' => 0 , 'ypos' => 200 )); 6 $ pdf -> selectFont ( '. / fonts / Helvetica.afm' ) 7 $ pdf ->
ezText ( 'dynamically generated PDF' , 50 ) 8
$ pdf -> ezText ( '' , 12); 9
$ pdf -> ezText ( 'Example of PDF using an image as Background. " , 12 ) 10
$ pdf -> ezNewPage (); 11 $ pdf -> ezText (
'Page 2' , 50 ) 12
$ pdf -> EzStream (); 13 ?>
Edit: looking for I've noticed that there are many more libraries to generate pdf with php here I leave a list. FPDF TCPDF FPDI
domPDF
0 comments:
Post a Comment