tcpdf

php tcpdf image string filter

孤街醉人 提交于 2019-12-13 20:24:30
问题 I've been trying to email a table containing a list of fieldname-value. When I reach an image value, I filter out the image string for use in tcpdf image output. I did a conditional that if data:image/png is found, it should be removed. Otherwise, remove data:image/jpeg. $pdf->writeHTMLCell(50, 0, '', '', "{$fieldname}", 1, 0, 0, true, 'R', true); $base64 = strpos("data:image/png", $col_value) ? str_replace("data:image/png;base64,", "", $field_value) : str_replace("data:image/jpeg;base64,", "

PHP TCPDF Create Multiple PDFS With One Command

馋奶兔 提交于 2019-12-13 18:13:15
问题 I want to export data with pdf.When i select one record it works fine...How to create multiple pdfs with one click? here is what i tried require_once('eng.php'); require_once('tcpdf.php'); $pageLayout = array(750, 800); $pdf =new TCPDF('P', 'pt', $pageLayout, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->AddPage(); $html = 'my html'; $pdf->writeHTML($html, true, false, true, false, ''); $pdf->lastPage(); $pdf->Output('filename.pdf', 'D'); How i can put one loop to create more

Different borders for the cell in tcpdf by “setlinestyle”

强颜欢笑 提交于 2019-12-13 14:33:31
问题 In library TCPDF. How can I set different borders by command "setlinestyle", to make the cell looks like f.e. this: css /* top */ border-top-width="1" border-top-style="solid" border-top-color="rgba(0, 255, 0, 1)" /* right */ border-right-width="2" border-right-style="dotted" border-right-color="rgba(255, 0, 255, 1)" /* bottom */ border-bottom-width="3" border-bottom-style="solid" border-bottom-color="rgba(0, 0, 255, 1)" /* left */ border-left-width="4" border-left-style="solid" border-left

Bloated PDF created by TCPDF

你。 提交于 2019-12-13 08:08:26
问题 In a web app developed in PHP we are generating Quotations and Invoices (which are very simple and of single page) using TCPDF lib. The lib is working just great but it seems to generate very large PDF files. For example in our case it is generating PDF files as large as 4 MB (+/- a few KB). How to reduce this bloating of PDF files generated by TCPDF? Here is code snippet that I am using ob_start(); include('quote_view_bag_pdf.php'); //This file is valid HTML file with PHP code to insert data

How do I display data in my foreach in EOD tcpdf?

为君一笑 提交于 2019-12-13 06:40:35
问题 I am new in the tcpdf.. I am currently doing a project where I am using the tcpdf(because I want to export my table in pdf that has a template of it). I tried to do some research and I've found the method writeHTML(). In this method I can now make any html tags Controller public function testing(){ $this->load->library('Pdf'); $this->load->model('newModel'); $data['accounts'] = $this->newModel->get('users'); $this->load->view('admin/testing',$data); } View $txt = <<<EOD <table cellspacing="0"

PHP and importing pdf with forms

一世执手 提交于 2019-12-13 04:41:54
问题 I'm having trouble importing an existing pdf file with forms (text fields, radio buttons...) with some php libraries like TCPDF, FPDI and PDFlib. When I import pdf file with forms, do some text print on it, save it, but the output pdf file does not contain forms anymore. is there a way to do this without loosing forms! please help tnx 回答1: try mpdf see the example 来源: https://stackoverflow.com/questions/8501117/php-and-importing-pdf-with-forms

TCPDF - White space at bottom of page

社会主义新天地 提交于 2019-12-13 04:40:30
问题 I am generating a pdf using TCPDF. First PDF was being generated a blank page in the end, but i fixed it by deleting page 2. Noe the problem is, the PDF background color is not being set for full page. There is about 100px long in height space at bottom of pdf page which does not have a background color. I need the page background color which is light blue, to be there from top to bottom. My document does not have header or footer. Here is the code: <?php require_once('tcpdf/tcpdf.php'); //

HTML2PDF with TCPDF not rendering Chinese characters in final PDF document

耗尽温柔 提交于 2019-12-13 02:26:45
问题 I am starting a new thread for this one, will try to be as specific as possible. This is a portion of an app for our sales people that allows them to customize a page with their contact information, after they hit submit, a PDF page is created which is then attached to the end of a larger document. The first page of the document is also dynamically created from the same form that they fill out. After they press submit, 2 PDF files are created, a front page and a back page, then both pages are

return TCPDF after server post ajax issue

拥有回忆 提交于 2019-12-13 02:13:54
问题 I am trying to return a tcpdf after validating a form. If there is an error in validation the php file returns an error msg. If the validation succeeds I want to return the PDF. Trouble is that when the pdf is returned it is not displayed as a PDF just garbage text. What change do I need to make in my code? Here is my ajax submit code: function postForm() { var ajaxRequest; /* Clear result div*/ $("#result").html(''); /* Get from elements values */ var values = $("#matchReportForm").serialize

TCPDF's getNumLines() is sometimes wrong

混江龙づ霸主 提交于 2019-12-12 18:29:28
问题 I use getNumLines() to estimate the number of lines before writing the text, besause it has to be positioned accordingly. It seems that getNumLines() calculates more space for the text then MultiCell() actually needs. A long line, that still fits into the cell when writing with MultiCell() seems to be soft-wrapped by getNumLines() : $lines = $pdf->getNumLines($text, $width); $pdf->MultiCell($width, 50, $text, 0, "L"); In my test $lines is 3 while only 2 lines are printed. If I increase the