tcpdf

TCPDF set bottom margin zero

狂风中的少年 提交于 2019-12-03 10:00:28
I am creating pdf using TCPDF in php,I need to include my data into pdf without bottom margines,The data will be included at the end of the page. $pdf->SetLeftMargin(14); $pdf->SetTopMargin(6); $pdf->SetFont($fontname, '', '9'); $pdf->setPrintHeader(false); $pdf->SetFooterMargin(0); $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->writeHTML($html, true, 0, true, 0); I am using the above code.Anyone know how to remove margin space from pdf using tcpdf? Margin that you are seeing is due to pageBreak margin Add this $pdf->SetAutoPageBreak(TRUE, 0); definitely remove margin from bottom try this

How to put HTML data into header of tcpdf?

一个人想着一个人 提交于 2019-12-03 09:16:59
问题 I'm using the tcpdf library to generate the pdf document. I'm using smarty template engine to hold the data. Below is the script to put in the header data: // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'PQR', 'XYZ'); I want to put HTML table content of smarty template in place of XYZ, the table content is going to be dynamic(meaning the data in table may vary for each PDF document). 回答1: As @vinzcoco says, you must extend TCPDF to achieve what you want

How to use TCPDF with PHP mail function

╄→尐↘猪︶ㄣ 提交于 2019-12-03 08:38:33
$to = 'my@email.ca'; $subject = 'Receipt'; $repEmail = 'rep@sales.ca'; $fileName = 'receipt.pdf'; $fileatt = $pdf->Output($fileName, 'E'); $attachment = chunk_split($fileatt); $eol = PHP_EOL; $separator = md5(time()); $headers = 'From: Sender <'.$repEmail.'>'.$eol; $headers .= 'MIME-Version: 1.0' .$eol; $headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\""; $message = "--".$separator.$eol; $message .= "Content-Transfer-Encoding: 7bit".$eol.$eol; $message .= "This is a MIME encoded message.".$eol; $message .= "--".$separator.$eol; $message .= "Content-Type: text/html; charset

TCPDF / FPDF - Page break issue

三世轮回 提交于 2019-12-03 07:29:43
I'm trying to create a PDF file with a table of data.. But when a page break is met it jumps to a new page everytime a new multicell is added to the page at the break point level..!? I have tried to do exactly the same with TCPDF, but still the same issue with a page break each time a new cell i added around the page break point level... example: http://www.online-økonomi.dk/_tst_fpdf.php require_once '../class/download/fpdf/fpdf.php'; class File_PDF { private $pdf; private $col_product = 25; private $col_unit = 12; private $col_price = 20; private $col_count = 14; private $col_discount = 12;

TCPDF set different headers for different pages in one document

会有一股神秘感。 提交于 2019-12-03 06:16:48
Is there a way to have a different header logo for the 1st page in a document and different for the 2nd page? I thought that changing the header data between adding pages might do the trick, but in my tests it seems that setting the header after adding the first page has no effect: /* other stuff $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf-

TCPDF: HTML table and page breaks

自闭症网瘾萝莉.ら 提交于 2019-12-03 03:13:26
问题 I am creating a large HTML table and I have problem with page breaks as you can see in the following image: Is there a method settle down the problem automatically? Or what is the way to do it? 回答1: Try adding this to your <tr> tags: nobr="true" . So a quick example would be: <table> <tr nobr="true"> <td>Test</td> <td>Test 2</td> </tr> </table> The nobr="true" prevents the table rows from ever breaking apart. You can also put this on <td> and <th> tags. 回答2: I know it's rather old question,

Php Shopping cart - Size and length for each quantity of a type of product

怎甘沉沦 提交于 2019-12-03 01:23:19
问题 I have been working on an online store. Project's aim is to add products to a shopping cart.. Customer should be able to change size & length for each quantity for a product. Example : I sell a Product named A customer order 5 pieces of product A So he should be able to set 5 size and lengths for product A as the quantity is 5. Then TCPDF is also there to email the created invoice. I just want some help with the setting of sizes and length for each quantity. Please Please help.. ALso if its

custom PHP tcpdf footer with top and bottom border

浪尽此生 提交于 2019-12-02 21:53:02
问题 First time use TCPDF, great library. I try to create a custom footer, however i want to create a custom footer that include the page number and date inside a div with top and bottom border! So any help? Many Thanks 回答1: Karel is right on this. you could however ignore the Footer() function if it's getting you in trouble with the dynamic of it. seems to me that you would like to have a div in your footer. to do this you have to get rid of the default footer first: $this->setPrintFooter(false);

TCPDF: HTML table and page breaks

偶尔善良 提交于 2019-12-02 16:40:51
I am creating a large HTML table and I have problem with page breaks as you can see in the following image: Is there a method settle down the problem automatically? Or what is the way to do it? Try adding this to your <tr> tags: nobr="true" . So a quick example would be: <table> <tr nobr="true"> <td>Test</td> <td>Test 2</td> </tr> </table> The nobr="true" prevents the table rows from ever breaking apart. You can also put this on <td> and <th> tags. I know it's rather old question, but I had this same issue today, my table was splitted between pages and I investigated a little bit further on

TCPDF remote image loading problem

女生的网名这么多〃 提交于 2019-12-02 16:03:02
问题 Im trying to load a remote image into a pdf generated by tcpdf however I can't seem to get it to work? The rest of the pdf loads fine and it looks like to trying to retrieve the image however it just does print to the page? The code I am using is: $pdf->Image("http://media.domain.com/logo.jpg", 0, 0, 100, 150, 'JPEG', '', 'T', true, 72,'','','','','','',''); Any help on this would be a massive help, Thanks, 回答1: I think you need to set allow_url_fopen = On in php.ini It works for me $pdf-