tcpdf

sending an email attachment using TCPDF

耗尽温柔 提交于 2019-11-28 09:24:12
PHP I have a simple course application form, which when filled, an email is sent to the applicant with a fees quotation for the courses he selected as a pdf attachment. I am using TCPDF and am passing the data from the form to the library using session variables. The content is in html format. The PDF is generated and sent as an attachment as required, Problem is that it is blank..only the header and footer is in the document. This is particularly so in linux. In windows the pdf document is generated as expected when downloaded. However, when you click on "view" before downloading the document

TCPDF HTML with Special Characters displays empty PDF file

落花浮王杯 提交于 2019-11-28 08:30:31
I am using TCPDF Library Version: 5.9.011. I am trying to execute HTML layout as PDF. For which I tried with example provide with the site $html = '<h1>HTML Example</h1> <h2>List</h2> Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash '; // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); //Close and output PDF document $pdf->Output('example_006.pdf', 'I'); Apparently found that generated PDF only default header and footer with middle content blank. However if I remove special characters like: $html = '<h1>HTML Example</h1> <h2

TCPDF ERROR: Some data has already been output, can't send PDF file

烈酒焚心 提交于 2019-11-28 06:54:14
I keep receiving this error when trying to add my own array into the code. Here is my array; $array = array(); while (odbc_fetch_row($rs)) { $array[] = odbc_result($rs,'Product Name'); } $test = print_r($array); The original code is here. I'm using an example page to try it because I know the example page works fine. http://www.tcpdf.org/examples/example_001.phps This code is before the $html variable and when it is set I just add the $test variable into the $html variable. The odbc connection works fine and the example works fine before I add any code but when I run the script I get this

HTML Rendering with TCPDF(PHP)

假如想象 提交于 2019-11-28 01:51:55
问题 I am using TCPDF's writeHtml function for a page that renders properly in the browser. In the output PDF, the fonts are too small. I've tried with setFont, but it doesn't seem to have an effect. Does anyone have experience with this? I'd like to add here that the HTML is not always in my control, so I would prefer to do this with TCPDF options(and not by modifying the source html) UPDATE : I am able to change the font size by setting it on the body. The only remaining problem is that, to

how TCPDF prevent the extra blank page

扶醉桌前 提交于 2019-11-28 01:34:54
I have create class to make page by using TCPDF. I need to convert HTML to pdf, so I using writeHTML and AcceptPageBreak() . The $html is Dynamically changed, could be very long. class MY_TCPDF extends TCPDF{ public function makePage($html){ $head_image="header.jpg"; $this->SetMargins(PDF_MARGIN_LEFT, 70, PDF_MARGIN_RIGHT); $this->setPrintHeader(false); $this->AddPage(); // get the current page break margin $bMargin = $this->getBreakMargin(); // get current auto-page-break mode $auto_page_break = $this->getAutoPageBreak(); // disable auto-page-break $this->SetAutoPageBreak(false, 0); // set

HTML2PDF in PHP - convert utilities & scripts - examples & demos

人盡茶涼 提交于 2019-11-27 23:15:43
I have a quite complicated HTML/CSS layout which I would like to convert to PDF on my server. I already have tryed DOMPDF, unfortunately it did not convert the HTML with correct layout. I have considered HTMLDOC but I have heard that it ignores CSS to a large extent, so I suppose the layout would break apart with that tool too. My question therefor is - are there any online demos for other tools (like wkhtmltopdf i.e.) that I could use to verify how my HTML is converted? Before spending the rest of my life installing & testing one by one? Unfortunately, I can't change the HTML layout to fit

TCPDF not render all CSS properties

六眼飞鱼酱① 提交于 2019-11-27 20:00:46
I try to make a PDF writing CSS and HTML but my CSS doesn't appear in my PDF. The only thing considered is the font-size and font-color. I give you the code (sorry, it's a little long...) $config = sfTCPDFPluginConfigHandler::loadConfig('my_config'); $doc_title = "Fiche Logement"; $html = <<<EOF <style> .informations { padding: 10px; margin: 10px; border: 1px dotted black;} .informations table { margin-top: 10px;} #modif { margin: 20px; text-align: left; float: right;} #modif th { padding-left: 10px;} #modif td { padding-left: 10px;} #adresse { width: 307px; float: left;} #reservataire { width

TCPDF and FPDI with multiple pages

泪湿孤枕 提交于 2019-11-27 16:54:39
问题 This looks like the simplest thing but I can't get it to work. I need to add text to the first page of a multi-page pdf (could be any number of pages) Using this code on a two page pdf (without the for loop, just using $pdf->importPage(2)) I end up with two pages but the second page is a repeat of page one. The text is written on the first page only which is good but I need all pages included in the output pdf. Here is my code // Original file with multiple pages $fullPathToFile = 'full/path

Changing or eliminating Header & Footer in TCPDF

冷暖自知 提交于 2019-11-27 15:31:50
问题 AddPage() in tcpdf automatically calls Header and Footer. How do I eliminate/override this? 回答1: Use the SetPrintHeader(false) and SetPrintFooter(false) methods before calling AddPage() . Like this: $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false); $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->AddPage(); 回答2: A nice easy way to have control over when to show the header - or bits of the header - is by extending the TCPDF class and creating your

Creating a new PDF by Merging PDF documents using TCPDF

梦想与她 提交于 2019-11-27 14:01:16
问题 How can I create a new document using other PDFs that I'm generating? I have methods to create some documents, and I want to merge them all in a big PDF, how can I do that with TCPDF? I do not want to use other libs. 回答1: TCPDF has a tcpdf_import class, added in 2011, but it is still "under development". If you don't want to use anything outside of TCPDF, you're out of luck! But FPDI is an excellent addition to TCPDF: it's like an addon. It's as simple as this: require_once('tcpdf/tcpdf.php')