Hi guys,
I would like to know if there is a way to generate pdf when clicking on a link. In fact, I would like to be able to click on a link and generate a pdf file with information from my database, say a profile of a client for example or an invoice.
I was able to generate a pdf using a basic tutorial. Here is the code:
Code: <?php
$mypdf = PDF_new();
PDF_open_file($mypdf, "");
PDF_begin_page($mypdf, 595, 842);
$myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0);
PDF_setfont($mypdf, $myfont, 10);
PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750);
PDF_show_xy($mypdf, "Made with the PDF libraries for PHP.", 50, 730);
PDF_end_page($mypdf);
PDF_close($mypdf);
$mybuf = PDF_get_buffer($mypdf);
$mylen = strlen($mybuf);
header("Content-type: application/pdf");
header("Content-Length: $mylen");
header("Content-Disposition: inline; filename=gen01.pdf");
print $mybuf;
PDF_delete($mypdf);
?>
But
1) it's seems to be pretty hard to have something that looks nice if I have to specify each item it location with X and Y
2) I have in the middle of the page: www.pdflib.com. I guess I have to pay for a licence to get rid of that but I went to the website and it's kind of expensive for me.
Do you know how an easier way to generate a pdf from my website and without having this "www.pdflib.com"? Is there another script out there or another lib?
Thanks
Curl timeout breaks script
So im having difficulties with skipping timeout error in curlmy script calls different functions my problem is lets say if in function2 is curl timeout error it wont continue with function3 but kills
Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well. The "$msgVar" goes into the body message of the email. How can I effect additional fields that can be
License Issue - service type user
Hi,
PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in. Moderators: Please excuse me if this is in the wrong category.The problem is that I am assigned with the task of
I need to increse 6hours more, and i don't know how???
I need to increse 6hours more, and i don't know how???<tr> <th>{ov_server_time}</th> <th
Error: SQL Syntax; Line 1
Code: <?php require "global_settings.php"; ?><title><?php echo $sitetitle; ?></title><center><style
Keeping track of php uploads
Hello all.I was looking at the way PHP handles file uploads.It seems that PHP uses a temporarily directory and file name for file uploads. e.g. /var/www/virtual/SITE/phptmp/phpMhOniLThis file is
Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bottom of the page:Code: <!--ddgbsre_erd_sdd--><?php
Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop or only echo once I can do the addition but it will echo 5 time in the loop.How would I go about
PHP arrays into arrays need help
HelloI am trying to highlight the days on my calendar based on the dates that i have in my database. Currently I can only get it to display the last element in the database which leads me to believe