tcpdf

TCPDF Save file to folder?

一笑奈何 提交于 2019-11-27 11:10:34
问题 I'm using TCPDF to print a receipt and then send it to customer with phpMailer, but I have a problem: I have no idea how to save the file into a pdf. I've tried this: // reset pointer to the last page $pdf->lastPage(); //Close and output PDF document $pdf->Output('kuitti'.$ordernumber.'.pdf', 'I'); $this->Output("kuitit"); 回答1: try this $pdf->Output('kuitti'.$ordernumber.'.pdf', 'F'); 回答2: this stores the generated pdf file in your custom folder of your project $filename= "{$membership->id}

to generate pdf download using tcpdf

Deadly 提交于 2019-11-27 07:49:07
问题 i am not able to generate pdf download,my code is as follows,can anyone tell me what is wrong with this code. include 'tcpdf.php'; $pdf = new TCPDF(); $pdf->AddPage('P', 'A4'); $html = '<html> <head></head> <body><table border="1"> <tr><th>name</th> <th>company</th></tr> <tr> <td>hello</td> <td>xx technologies</td> </tr> </table> </body> </html>'; $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output(); ?> 回答1: I have modified your code and it works. [TESTED] <?php require_once(

TCPDF & mPDF error: Some data has already been output to browser, can't send PDF file

倾然丶 夕夏残阳落幕 提交于 2019-11-27 07:46:26
问题 The Problem: TCPDF & mPDF error: Some data has already been output to browser, can't send PDF file I gave up on trying to fix the error with TCPDF and installed mPDF only to get the same error when attempting to render the document to the browser. I can save the document just fine and have it displayed in the browser upon retrieval. Additionally, this error only presented itself after switching from my dev server to my host server. Works fine on DEV server (DEV server = WAMPSERVER, PROD

TCPDF UTF-8. Lithuanian symbols not showing up

◇◆丶佛笑我妖孽 提交于 2019-11-27 07:26:55
Im using latest TCPDF version(5.9). But have some strange problems with encoding. I need Lithuanian language symbols like: ąčęėįšųūž. But get only few of it. Other remain like ????? So what should I do ? I use default times font(it comes with TCPDF download). Any help would be appreciated. Set the $unicode parameter on the TCPDF constructor to false and the $encoding parameter to 'ISO-8859-1' or some other character map. This will help you: Default for UTF-8 unicode: $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); Example of constructor for European

How to generate multilingual content Pdf in PHP

▼魔方 西西 提交于 2019-11-27 07:08:09
问题 I am using TCPDF to generate multilingual content PDF in PHP. I am using TCPDF and using font 'cid0jp' but It is forcing user to download language pack for adobe reader. Is there any way to generate multilingual pdf without enforcing user to download any langauge pack? 回答1: Yes, there's a way. I just had the same issue. Why Adobe Reader is asking for the language pack i don't know. But i know that the best way to create multilingual PDFs is to use the Arial Unicode MS -Font which is included

sending an email attachment using TCPDF

╄→гoц情女王★ 提交于 2019-11-27 02:54:10
问题 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

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

五迷三道 提交于 2019-11-27 01:35:47
问题 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

Why does TCPDF ignore my inline CSS?

佐手、 提交于 2019-11-27 00:51:41
I am trying to create a PDF file using TCPDF. But When I tried to insert inline CSS into the HTML, it's displaying a blank page! Here are a few lines of my HTML: pdf->AddPage(); // set font $pdf->SetFont('helvetica', 'B', 20); $pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0); // create some HTML content $html = ' <div id="wrapper" style="width:900px;height:auto;margin:0 auto;"> <div id="header" style="width:900px;height:180px;border-bottom:2px solid #5a5a5a;"> <div id="img" style="width:174px;height:87px;position:relative;top:10px;left:350px;"><img src=

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

喜你入骨 提交于 2019-11-26 23:17:25
问题 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

How to implement custom fonts in TCPDF

ⅰ亾dé卋堺 提交于 2019-11-26 22:20:45
In TCPDF, there are only a few fonts to choose from, to create pdf files. I want to set Tahoma as my pdf font. How can I include Tahoma in TCPDF?? Nicola Asuni The latest TCPDF version automatically convert fonts into TCPDF format using the addTTFfont() method. For example: // convert TTF font to TCPDF format and store it on the fonts folder $fontname = TCPDF_FONTS::addTTFfont('/path-to-font/FreeSerifItalic.ttf', 'TrueTypeUnicode', '', 96); // use the font $pdf->SetFont($fontname, '', 14, '', false); For further information and examples, please check the TCPDF Fonts documentation page . NOTE: