tcpdf

How to embed fonts into a PDF with TCPDF?

蓝咒 提交于 2019-12-25 19:02:33
问题 I have tried to use TCPDF whose code is given below: require_once($_SERVER['DOCUMENT_ROOT'].'/tcpdf/tcpdf.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('TCPDF Example 061'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetDefaultMonospacedFont(PDF_FONT

TCPDF How do you make a link to the Table of Contents (TOC)?

☆樱花仙子☆ 提交于 2019-12-25 16:59:27
问题 Can anyone demonstrate a basic example that adds a link on an arbitrary page in the pdf that takes the user back to the table of contents? I have everything working fine, but can't get this simple requirement going. Some background: You'd think this would be trivial, everything about TCPDF seems to function so well, maybe a bad day I'm having. I have tried the following: From the documentation there seems to be 2 options for creating internal document links Via methods addlink() and setlink()

Using TCPDF to Convert specific div to PDF

一曲冷凌霜 提交于 2019-12-25 06:25:57
问题 I have a web application written in javascript. At the end of the application, the user is presented with a receipt that shows all their actions during the course of their operating the application. I want convert this receipt into a PDF file so that it can be accessed more easily (e.g., download, print, etc.) I am having trouble targeting the specific div that I wish to use as the receipt. <div id="receipt"> --- Some Content --- </div> I want to target the specific div 'receipt' but only at

tcpdf working on localhost but not on my sever giving error TCPDF ERROR: [Image] Unable to get image:

本秂侑毒 提交于 2019-12-25 05:30:07
问题 I working in cakephp 1-3. I create function to generate PDF by TCPDF. It working very well on localhost but i upload it on sever It giving following error TCPDF ERROR: [Image] Unable to get image: http://camlabwebdesign.co.uk/R/homesone/images/property_images/2011_09_29_05_08_17_download-free-desktop-wallpaper-nature-sealion-mtchm.jpg I check all file permissions but it not working on sever. thanks 来源: https://stackoverflow.com/questions/10102175/tcpdf-working-on-localhost-but-not-on-my-sever

TCPDF Text and Image Positioning

你离开我真会死。 提交于 2019-12-25 01:07:46
问题 So I am trying to generate a PDF of car plates using TCPDF. Basically, the text and image should always be in the center of the box. I managed to to it by using the positioning. The format should be as follows: AAA <img> BB CCC Notice the larger space between BB and CCC . The space between the image at the center is the same between AA and <img> and <img> and BB . Exhibit A Now, my main issue is, I can get the following to display(This is perfectly aligned and spaced. Also notice larger space

Preview pdf file created with TCPDF in embed tag after Ajax call

房东的猫 提交于 2019-12-24 13:44:14
问题 So my application generates pdf files using TCPDF, and that works fine. That is done inside php file, called with ajax. I'm using embed tag to preview them like: $.ajax({ url: 'create_pdf_file.php', success: function(){ /* https://stackoverflow.com/questions/17083018/jquery-loads-cached-file-inside-ajax-success-function */ $('#pdf_placeholder embed').attr('src','output/my_file.pdf?v=' + Math.random()'); } }); Because many users could generate my_file.pdf at the same time, there could be a

TCPDF Write() after writeHTMLCell() won't display nothing

微笑、不失礼 提交于 2019-12-24 12:47:31
问题 After I use $pdf->writeHTML(....) nothing is displayed on the same page. If I use $pdf->AddPage() then the text written with $pdf->Write(...) is displayed again. Why? What should I do to write on the same page? $html = '<table>...</table>'; $pdf->writeHTMLCell(0, 120, '', '', $htmlbody); $pdf->Write(5, 'some text', ''); some text isn't displayed. If I add: $html = '<table>...</table>'; $pdf->writeHTMLCell(0, 120, '', '', $htmlbody); $pdf->AddPage(); $pdf->Write(5, 'some text', ''); some text

Bangla (Unicode) font not rendering correctly in tcpdf

*爱你&永不变心* 提交于 2019-12-24 11:34:46
问题 I am facing a problem with generating pdf in php by using TCPDF library. I need to show the bangla font correctly. I tried to add some bangla font(i.e. SolaimanLipi.ttf, SutonnyOMJ.ttf, Siyamrupali.ttf, Nikosh.ttf and so on). I can see the bangla font on pdf but the font is not display correctly. Its misplaced the word. By adding this font I see the on the /fonts/ directory there successfully created 3 file “solaimanlipi.ctg.z”,”solaimanlipi.php” and “solaimanlipi.z”. As well as I can see the

Phpmailer add PDF attachment from a link

 ̄綄美尐妖づ 提交于 2019-12-24 11:29:52
问题 I'm using PHPMailer to send automatic email (obviously using PHP as programming language). I would like to add a PDF attachment generated with TCPdf. Unfortunately I cannot generate the PDF inside the php page where I'm using PHPMailer, and I cannot create a function that generate it. I can only use a link to generate it, like this: www.mypage.com/app-pdf/link_generate_pdf.php?IDToGenerate=131&PDFOutput=I I was thinking that I can recall the page with the PDFOutput=S and "return" in some way

Creating PDF Helper for CakePHP 2.0 using TCPDF

痞子三分冷 提交于 2019-12-24 10:17:45
问题 I'm currently working on a PDF view for my cake application and found this tutorial. http://www.startutorial.com/articles/view/how-to-create-pdf-helper-with-tcpdf But currently I'm struggling over this error message: Notice (8): Undefined variable: pdf [APP\View\Pdfs\index.ctp, line 2] Notice (8): Trying to get property of non-object [APP\View\Pdfs\index.ctp, line 2] Fatal error: Call to a member function addPage() on a non-object in \app\View\Pdfs\index.ctp on line 2 Can anyone help me out,