tcpdf

'insufficient data for an image' message when opening PDF

白昼怎懂夜的黑 提交于 2019-12-12 15:20:21
问题 My php cli application creates PDF's by using the TCPDF library. In most cases PDF's are created successfully, but sometimes a PDF is created that makes adobe reader pop up the error: 'insufficient data for an image'. I obviously did some research on this message, and none of the named causes nor provided solutions are relevant in my case or solve the problem. Although Adobe products are the only ones that pop up an error and other PDF viewers can open the corrupt file and display it correct,

Can TCPDF / FPDI accept PDF as string?

半世苍凉 提交于 2019-12-12 14:43:14
问题 Is it possible to feed TCPDF or FPDI PDFs as a string? I have an incoming array of PDFs as strings, and I can't write to disk. I wasn't able to find anything in the documentation about this. If not, is there an efficient way to store/read these PDFs from memory or as objects? as to feed them to FPDI? 回答1: FPDI does not accept strings, but TCPDI, which I just released, has a setSourceData() method in addition to FDPI's setSourceFile() , as I happened to have the exact same requirement. TCPDI

TCPDF font not embadding, showing “…” on adobe reader

寵の児 提交于 2019-12-12 10:53:50
问题 I added many fonts in TCPDF using this line of code TCPDF_FONTS::addTTFfont('fonts/ArchitectsDaughter.ttf', 'TrueTypeUnicode', '', 96); $pdf->AddFont("ArchitectsDaughter"); Many other font is working but, this one is not working. When i opening this pdf into reader, it shows error like this cannot extract the embedded font 'ArchitectsDaughter'. some character may not display or print correctly. I am importing svg file in pdf. Here is the SVG file which i inserting in pdf, and you can get PDF

<strong> tag using TCPDF

随声附和 提交于 2019-12-12 04:45:36
问题 I'm having a hard time generating PDFs with TCPDF. Generally, everything works fine, but, sometimes when I use the <strong> tag, everything gets messed up. I have 2 examples here: http://ontheweb.com.br/pdf/ex2.pdf How can I fix this? 回答1: I don't have an answer, but this might be related: The problem arises when using justify property AND there are some line breaks AND bold. The justify proccess seems to have some problems if the firsts words of the next line are bold. Via http://sourceforge

How to apply tcpdf tamil font by using codeigniter

感情迁移 提交于 2019-12-12 04:16:35
问题 I apply this line: $pdf->SetFont('freeserif', '', 14, '', true); but my not getting the exact output. 回答1: when using TCPDF library you can make your class by inherit from TCPDF class: class MYPDF extends TCPDF { you can override the footer and header function as you like, and inside these functions you can set your font. but TCPDF contains some fonts if you want add new font you must download it and extract it in tcpdf/fonts/utils folder and use it by this way: $ge_hili_light = $this-

how to view table data in tcpdf

我与影子孤独终老i 提交于 2019-12-12 03:16:52
问题 i'm a new one for codeigniter and tcpdf. now i want to show my database table row in pdf. i don`t know how to do that. any one can help me please where i should insert the code and how to write the code. this is the code for pdf generator <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Createpdf extends CI_Controller { function __construct() { parent::__construct(); $this->load->library("Pdf"); } public function create_pdf() { // create new PDF document $pdf =

Split Table After X Number of Rows & Add Text in While Loop (Using TCPDF)

南笙酒味 提交于 2019-12-12 01:42:55
问题 I have this statement which produces as many rows as it should do: $result = mysqli_query($con,"SELECT * FROM b_sale_basket WHERE ORDER_ID=$ID ORDER BY PRICE * QUANTITY DESC"); $total=0; while($row = mysqli_fetch_array($result)) { $quantity = $row['QUANTITY']; $description = $row['NAME']; $unitprice = $row['PRICE']; $lineprice = $row['PRICE']*$row['QUANTITY']; $total=$total+$lineprice; $tbl_header = '<table style="width: 650px;" cellspacing="0" cellpadding="5">'; $tbl_footer = '</table>';

TCPDF Multiple Footers

荒凉一梦 提交于 2019-12-11 22:22:08
问题 I am using TCPDF to generate PDF documents. The problem I have is that I am trying to add a different footer per page. Apparently, TCPDF provides a solution only for a single footer. Each footer contains only basic html code without any styling. Any ideas? 回答1: You can turn of the default footer like this: $pdf->SetPrintFooter(false); create your own one like this: $footer = 'yau man footer stuff'; and then create your own footer function: public function _footer($input) { $text = $input;

laravel pdf package that can load views and support arabic

谁说胖子不能爱 提交于 2019-12-11 20:14:10
问题 I'm looking for a laravel 4 package that can do both, loading views and supporting arabic (and non-latin) fonts. I've tried domPDF and TCPDF but the first doesn't support Arabic while the second can't load views 回答1: Try "WKHTMLTOPDF" i use it with ZF2 and have no problems at all. Just google for sure there are packages. 回答2: Have you tried the package from Barry? (https://github.com/barryvdh/laravel-dompdf) This package has build-in support for views, accessing the storage folder for fonts

Embedding charts in the PDF using TCPDF library

非 Y 不嫁゛ 提交于 2019-12-11 19:33:52
问题 I am working on a project in which a PDF file is to be generated. I have used Google Chart API for generating different charts. I am using the TCPDF library for converting them into PDF but I am unable to embed these genearted graphs into the PDFs. I think TCPDF does not accept the contents written in the script tag. How can I overcome this problem? 回答1: I ran into the same problem except I was using FPDF. At the end of the day, a PDF file contains static content, so Javascript is out of the