Search Results

Search found 50 results on 2 pages for 'tcpdf'.

Page 1/2 | 1 2  | Next Page >

  • Using TCPDF and FPDI with cake php

    - by kwhohasamullet
    Hi Guys, I have go TCPDF setup in my cake php install and am now trying to also use FPDI with it as i need to add a PDF to the start of the PDF that is being generated. WHen trying to do this i am using 3 classes XTCPDF which holds my header data FPDI - FPDI class TCPDF - TCPDF class and it is setup as so: XTCPDF extends FPDI FPDI extends TCPDF When i try and generate a PDF with this using commands from teh FPDI classs i get the following error: Fatal error: Cannot access protected property XTCPDF::$PDFVersion in C:\Program Files\XAMPP\xampp\htdocs\quote\app\vendors\fpdi\fpdi_pdf_parser.php on line 388 Im thinking this may be a scope problem but im not too sure, i have also tested by changing it around to not include XTCPDF class but the same error occurs, EDIT: The code that i am using that accesses the FPDI class is: $tcpdf->setSourceFile(APP.'webroot'.DS.'img'.DS.'pdf'.DS.'front_cover.pdf'); $frontCover = $tcpdf->importPage(1); $tcpdf->useTemplate($frontCover); Thanks in advance for any help :D

    Read the article

  • Bloated PDF created by TCPDF

    - by Yogi Yang 007
    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 from DB $quote = ob_get_contents(); //Capture the content of 'quote_view_bag_pdf.php' file and store in variable ob_end_clean(); //Code to generate PDF file for this Quote //This line is to fix a few errors in tcpdf $k_path_url=''; require_once('tcpdf/config/lang/eng.php'); require_once('tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(); // remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // add a page $pdf->AddPage(); // print html formated text $pdf->writeHtml($quote, true, 0, true, 0); //Insert Variables contents here. //Build Out File Name $pdf_out_file = "pdf/Quote_".$_POST['quote_id']."_.pdf"; //Close and output PDF document $pdf->Output($pdf_out_file, 'F'); $pdf->Output($pdf_out_file, 'I'); /////////////// enter code here Hope this code fragment will give some idea?

    Read the article

  • Nested table height in TCPDF

    - by Kuroki Kaze
    Is it possible to make nested table fit height of its parent cell in TCPDF? My code: <?php require_once('tcpdf/config/lang/eng.php'); require_once('tcpdf/tcpdf.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetFont('times', 'BI', 8); $pdf->AddPage(); $pdf->writeHTML('<table> <tr><td bgcolor="gray"> Angoisse et vif espoir, sans humeur factieuse.<br/> Plus allait se vidant le fatal sablier,<br/> Plus ma torture était âpre et délicieuse;<br/> Tout mon coeur s’arrachait au monde familier</td> <td bgcolor="lightgray">Second</td> <td bgcolor="gray">Third</td> <td> <table style="height: 100%"> <tr bgcolor="blue" style="height: 30%"><td bgcolor="yellow" style="height: 30%">Ichi</td></tr> <tr bgcolor="white" style="height: 30%"><td bgcolor="cyan" style="height: 30%">Ni</td></tr> <tr bgcolor="blue" style="height: 30%"><td bgcolor="yellow" style="height: 30%">San</td></tr> </table> </td></tr> </table>'); $pdf->Output('example_002.pdf', 'I'); ?> I want table in last cell to fill it entirely. Is there any way to do this?

    Read the article

  • TCPDF Auto Page Break Not Working if Widths set

    - by kenitech
    I have a very specific 2 column layout I'm trying to set up for a client using TCPDF. AutoPageBreak works fine if you're sending text to a page with writeHTML and multiCell at the default width of the page. When I set a narrower width for a multiCell TCPDF doesn't know when to page break. This is driving me insane. Here's super simple example set up here: http://www.artworknotavailable.com/temp/tcpdf/

    Read the article

  • how to write barcode in html format when using tcpdf

    - by JewelThief
    I am using TCPDF to generate PDF file using following command $pdf-writeHTML($htmlcontent, true, 0, true, 0); TCPDF also provides a way to create barcode with following commands $pdf-Cell(0, 0, 'C39+', 0, 1); $pdf-write1DBarcode('Code 39', 'C39+', '', '', 80, 15, 0.4, $style, 'N'); $pdf-Ln(); I want to be able to write barcode as part of the HTML code above. Is there easy way? I can potentially call a barcode image inthe writeHTML code above, but not sure how to use above barcode function ( or any in TCPDF) which would allow me to create image and then get that image into HTML generation

    Read the article

  • [PHP & TCPDF] How to center html table?

    - by user198003
    Trying to create proper PDF document, using PHP and TCPDF. Can you help me, how can I use writeHTML function to create and center table, in TCPDF? Tryed with: $html = ' <div style="margin-left: auto; margin-right: auto; width: 50%"> <table border="1" width="200" align="center"><tr><td><b>Invoice number: '.$this->xInvoiceNumber.'</b></td></tr></table> <br /> <table border="1" width="200" align="center"><tr><td>'.$this->xClient.'</td></tr></table> <br /> </div> ... but no luck.

    Read the article

  • Getting the height of text to know fill height as in TCPDF

    - by sami
    I'm trying to go through the code of TCPDF to understand how it calculates the height of the text to be rendered, but it's too much for me to handle without asking. What I want to know: in the PDF from example 5 http://www.tcpdf.org/examples/example_005.pdf it gives the cell a yellow background. I'm guessing that at the basic level, it first draws a box with this fill color, then adds the text, so what method is it calling to get the height of the text to know the height of the box to fill? Anyone knows how to trace this, because doing it by hand and looking through the code isn't working at all for me.

    Read the article

  • I have two problems about tcpdf

    - by cubuzoa
    Hi i am using tcpdf in my application and i have two question about that.I am able to get pdf output of a html page when i click specified button. My first question is:How can i download that html's pdf output when i click that button?($pdf-lastPage() didn'work). My second question is:How can i set character encoding for Trkish?(I am using dejavusans but some turkish characters appears as question mark) Thank for advance...

    Read the article

  • TCPDF remote image loading problem

    - by Leonard Austin
    Hi, 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,

    Read the article

  • TCPDF Specific border for different sides

    - by Metropolis
    Hey Everyone, I just started using TCPDF (output with HTML), and I do not understand why I can not have an inline CSS style for border like the following, style="border-right: 1px" After looking at some of the examples, the only place I see borders being used is on a table using the border="1" property. This is very frustrating, and I hope there is a way for me to use all inline CSS instead of old HTML attributes like "border". Thanks for any help, Metropolis

    Read the article

  • word wrap in tcpdf

    - by ChuckO
    I'm using tcpdf to creat a pdf version of the html table below. How do I word wrap the text in the cells? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style type="text/css"> table.frm { width: 960px; Height:400px; margin-left: auto; margin-right: auto; border-width: 0px 0px 0px 0px; border-spacing: 0px; border-style: solid solid solid solid; border-color: gray gray gray gray; border-collapse: collapse; background-color: white; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 11px; } table.frm th { Width: 120px; border-width: 1px 1px 1px 1px; padding: 1px 1px 1px 1px; border-style: solid solid solid solid; border-collapse: collapse; border-color: gray gray gray gray; background-color: white; } table.frm td { width: 120px; height: 80px; vertical-align: top; border-width: 1px 1px 1px 1px; padding: 2px 2px 2px 2px; border-style: solid solid solid solid; border-collapse: collapse; border-color: gray gray gray gray; background-color: white; } </style> <title>Weekly Menu</title> </head> <body> <table class="frm"> <tr> <th align="center" colspan="8"><b>WEEKLY MENU</b></th> </tr> <tr> <th align="center" colspan="8"><b>Your Name Here</b></th> </tr> <tr> <th></th> <th>Monday</th> <th>Tuesday</th> <th>Wednesday</th> <th>Thursday</th> <th>Friday</th> <th>Saturday</th> <th>Sunday</th> </tr> <tr> <td><b>Breakfast</b></td> <td>Scrambled Eggs Black Coffee</td> <td>Vegetable Omelet Black Coffee</td> <td>2 slices Toast Black Coffee</td> <td>Cereal w/milk Black Coffee</td> <td>Orange Juice Black Coffee</td> <td>Cereal w/milk Black Coffee</td> <td>Pancakes w/syrup Black Coffee</td> </tr> <tr> <td><b>Lunch</b></td> <td>Tuna Salad Sandwich Diet Coke</td> <td>Greek Salad Black Coffee</td> <td></td> <td>Amer Cheese Sandwich Orange Juice</td> <td></td> <td></td> <td></td> </tr> <tr> <td><b>Dinner</b></td> <td>Burger Fried Onions Diet Coke</td> <td>Steak Fries Diet Sprite</td> <td></td> <td>Chicken Cutlet Baked Potato Peas</td> <td></td> <td></td> <td></td> </tr> <tr> <td><b>Snack</b></td> <td>Apple</td> <td>Orange</td> <td>Sm bag of chips</td> <td>Celery Sticks</td> <td></td> <td></td> <td></td> </tr> </table> </body> </html> This is the tcpdf code: $pdf = new TCPDF('Landscape', 'mm', '', true, 'UTF-8', false); $pdf->SetTitle('Weekly Menu'); $pdf->SetMargins(15, 7.5, 12.5); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); $pdf->AddPage(); $pdf->setFormDefaultProp(array('lineWidth'=>0, 'borderStyle'=>'dot', 'fillColor'=>array(235, 235, 255), 'strokeColor'=>array(255,255,250))); $pdf->SetFont('times', 'BU', 12); $pdf->cell(250, 8, 'Weekly Menu', 0, 1, 'C'); $pdf->cell(250, 8, $yourname, 0, 1, 'C'); $pdf->SetFont('times', '', 10); $cw=35; $ch=25; $pdf->SetXY(15,50); $pdf->cell(25,5,'',1,0,'L'); $pdf->cell($cw,5,$day1,1,0,'C'); $pdf->cell($cw,5,$day2,1,0,'C'); $pdf->cell($cw,5,$day3,1,0,'C'); $pdf->cell($cw,5,$day4,1,0,'C'); $pdf->cell($cw,5,$day5,1,0,'C'); $pdf->cell($cw,5,$day6,1,0,'C'); $pdf->cell($cw,5,$day7,1,1,'C'); $pdf->cell(25,$ch,'Breakfast',1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[0]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[1]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[2]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[3]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[4]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[5]->breakfast,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[6]->breakfast,1,1,'L',0,0,false,'','T'); $pdf->cell(25,$ch,'Lunch',1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[0]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[1]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[2]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[3]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[4]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[5]->lunch,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[6]->lunch,1,1,'L',0,0,false,'','T'); $pdf->cell(25,$ch,'Dinner',1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[0]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[1]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[2]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[3]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[4]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[5]->dinner,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[6]->dinner,1,1,'L',0,0,false,'','T'); $pdf->cell(25,$ch,'Snack',1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[0]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[1]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[2]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[3]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[4]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[5]->snack,1,0,'L',0,0,false,'','T'); $pdf->cell($cw,$ch,$record[6]->snack,1,1,'L',0,0,false,'','T'); EOD;

    Read the article

  • tcpdf table header in each page

    - by DragoN
    i am using tcpdf to create pdf files with rows of table in the first page of pdf i display some info like : List of table .... and header of table after that i display the rows in table if there much rows it contiunes in the next page without the info [List of table... and header of table] i want to display the header of table only in the next pages here is my code $pdf->SetFont('aefurat', '', 15); $pdf->AddPage('P', 'A4'); $pdf->SetFontSize(17); $pdf->Cell(0, 13, 'List of the Byan Table,'C'); $pdf->SetFont('dejavusans', '', 14); $htmlpersian = 'In / Out List'; $pdf->WriteHTML($htmlpersian, true, 0, true, 0); $pdf->setRTL(false); $pdf->SetFontSize(11); $pdf->setRTL(true); Connect(); $resultsc = mysql_query("SELECT * FROM byan Order By Date "); while($r = mysql_fetch_array($resultsc)) { $printresult .= ' <tr> <td ><center>'.$r['Date'].'</center></td> <td ><center>'.$r['In'].'</center></td> <td ><center>'.$r['Out'].'</center></td> <td ><center>'.$r['Balance'].'</center></td> <td ><center>'.$r['Info'].'</center></td> <td ><center>'.$r['Number'].'</center></td> </tr>'; } $tbl = ' <table cellspacing="0" cellpadding="1" border="1" align="center"> <tr> <td style="width: 13%; background-color:black; color:white;"><center>Date</center></td> <td style="width: 11%; background-color:black; color:white;"><center>In</center></td> <td style="width: 11%; background-color:black; color:white;"><center>Out</center></td> <td style="width: 12%; background-color:black; color:white;"><center>Balance</center></td> <td style="width: 45%; background-color:black; color:white;"><center>Info</center></td> <td style="width: 11%; background-color:black; color:white;"><center>Number</center></td> </tr> '.$printresult.' </table> '; $pdf->writeHTML($tbl, true, false, true, false, ''); the output is First Page: List of the Byan Table In / Out List Table Header rows Second Page: Rows Third Page: Rows i want the output to be like that First Page: List of the Byan Table In / Out List Table Header Rows Second Page: Table Header Rows Third Page: Table Header Rows

    Read the article

  • Is there a way to use the transactions in TCPDF when extending it with FPDI?

    - by Darryl Hein
    I am using TCPDF with FPDI's bridge. The issue I'm having is that as soon as I use the startTransaction() I get the following error: TCPDF ERROR: Cannot access protected property FPDI:$numpages / Undefined property: FPDI::$numpages and the script ends (because of the die in the TCPDF::Error() method). Here is the code I'm using: $pdf = new FPDI(); // add a page $pdf->AddPage(); $pdf->startTransaction(); $pdf->Cell(0, 0, 'blah blah blah'); $pdf->rollbackTransaction(); $pdf->Output( . time() . '.pdf', 'D'); If I change it to: $pdf = new FPDI(); // add a page $pdf->AddPage(); $pdf->Cell(0, 0, 'blah blah blah'); $pdf->Output( . time() . '.pdf', 'D'); it works fine. Is there anyway to make them work together and use TCPDF's transactions?

    Read the article

  • How to calculate the height of a MultiCell/writeHTMLCell in TCPDF?

    - by merkuro
    I try to create a PDF with multiple pages and need to calculate the height of each individual element (MultiCell) in advance to prepare for a page break. According to the documentation there are a couple of functions out there like GetCharWidth/GetStringWidth to support me in doing it on my own, but besides a potential performance lost I probably will not do it the right anyway. Suggestions to achieve my goal in a more elegant way? Reference: TCPDF

    Read the article

  • tcpdf - HTML table showing up way too small

    - by LinuxGnut
    Hi folks. I'm using tcpdf (http://www.tcpdf.org/) to generate PDFs of some tables and images. The images are loaded without an issue, but I'm having issues with the writeHTML() function. I can't seem to control the font sizes or table width/height through the HTML, so I end up with a tiny, tiny, tiny table that you have to print of and squint at to even attempt reading. I've tried editing the table itself, CSS, even putting the table itself inside an h1, but nothing is changing the font size. I have the font size in tcpdf set to 16, but this also has no affect. Has anyone else run into this issue?

    Read the article

  • Which is the best PDF library for PHP?

    - by Darryl Hein
    I'm wondering which is the best PDF creation library for PHP, mainly for creating PDFs from scratch (not as much HTML to PDF)? I have worked with FPDF for quite a while now, but it's getting quite old and hasn't had much for updates. I found TCPDF the other day (thanks you another question on SO). It seems very good and is based on FPDF so I don't think it'd be a big transition. FPDI also supports TCPDF which is nice as I have used it before and found it be useful. I have also seen DOMPDF but it too hasn't had many updates for quite some time and is lacking a lot of functionality for general PDF generation. Zend (Zend_Pdf) as well as many other libraries have their own PDF libraries or extend another one, but you often have to setup the entire library, which for existing projects can be a problem. What other libraries are there and what have your experiences with them been with the above or other libraries?

    Read the article

  • PDF writeHTML for rendering tables

    - by sami
    I'm using TCPDF and following this example which uses writeHTML and heredoc syntax to write a table. http://www.tcpdf.org/examples/example_048.phps I'm trying to do though is switch the font using setFont before writing each column. This means I have to break the html and write it on different pieces (see pseudo code). But once I break the HTML like that, it doesn't work, I think because it becomes invalid. writeHTML <tr> writeHTML first column setFont() writeHTML second column writeHTML </tr> I want to use writeHTML because it helps me write the table without having to manually construct. But how can I make modifications before I output each cell?

    Read the article

  • text flowing out of border in pdf

    - by Jasim
    I have created a pdf using tcpdf in php. i have a table with one row and one column. when i put the content from a form which is a textarea, the content in the form flows out of the table border. how can i make it so that it is contained in the border itslef???

    Read the article

  • WHMCS Fatal error: Out of memory while View Invoice PDF

    - by prakash
    I can log into WHMCS & can access everything I should be able to access, but if i try to click View PDF Invoice, the following error will occur, Fatal error: Out of memory (allocated 67633152) (tried to allocate 76 bytes) in /home/xxxx/public_html/whmcs/includes/classes/class.tcpdf.php on line 8419 I have already set the allocated Memory limit to 256MB, but the error still occurs. At that time of the error, the process memory is exceeding the allocation I set. I checked log file, and found the following errors: #2 /home/xxxxx/public_html/client/includes/classes/class.tcpdf.php(8453): TCPDF->Image('/home/xxxxx/...', 20, 25, 75, 17.5816023739, 'PNG', '', '', false, 300, '', false, 8) #3 /home/xxxxx/public_html/client/includes/classes/class.tcpdf.php(7881): TCPDF->ImagePngAlpha('/home/xxxxx/...', 20, 25, 337, 79, 75, 17.5816023739, 'PNG', '', '', false, 300, '', NULL) While I was investigating the issue above I also noticed the error condition pictured below:

    Read the article

  • Unable to print A6 on Canon LBP 2900B php

    - by ????? ???
    I am working on web application. In which I have to print an invoice on A6 paper. To better control priniting I used TCPDF. In TCPDF options I have setup it to print A6. Now my TCPDF is working fine. But there is problem in printing it on Canon LBP2900B. As there is no option available to print A6 page. When I try to print on it. It used A4 paper to print it. I have also checked Custom options in Canon. But unable to figure out how to print it using Canon printer.

    Read the article

  • HTML2PDF Conversion.

    - by piemesons
    I downloaded these Project files for converting html to pdf. but when i am trying to run any example its giving me error: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\html2pdf\html2pdf.class.php:960) in C:\xampp\htdocs\html2pdf\_tcpdf\tcpdf.php on line 5499 TCPDF ERROR: Some data has already been output to browser, can't send PDF file I am not able to figure this out. Can anybody help me.Its just a matter of 1 min work but i m so stupid that i am not to figure this one. Actually i am trying to do this

    Read the article

  • Dinamically creating a member ID card as pdf using PHP?

    - by aefxx
    I need to code a PHP script that would let me generate a pdf file which displays a member ID card (something like a credit card used to identify oneself) at a certain resolution. Let me explain: I do have the basic blueprint of the card in png file format. The script needs to drop in a member's name and birth day along with a serial. So far, no problem - there are plenty of good working PHP librarys out there. My problem is to ensure that the resulting pdf (the generated image of the card, to be precise) meets a certain resolution (preferably 300dpi), so that printing it would look right. Any ideas? EDIT I solved it using the TCPDF library which let's you scale images at a certain resolution. Get it here: http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf

    Read the article

1 2  | Next Page >