tcpdf

The imageSVG() method of tcpdf is not rendering correctly the svg file

狂风中的少年 提交于 2019-12-24 09:58:54
问题 I have the following svg file: http://jsfiddle.net/wptn28c5/ <svg></svg> that renders: However, by using tcpdf ($pdf->imageSVG()) i get a pdf file that renders: 回答1: The SVG standard is not fully implemented in TCPDF, so not all SVGs will render correctly inside TCPDF as is. For those cases you'll either need to use setRasterizeVectorImages (requires ImageMagick) to rasterize the SVG on the fly for you - or tweak the SVG into a form that would work. With this specific file, I suspect that the

TCPDF: Writing multiple images after eachother using writeHTML renders images in a “staircase” shape instead of in a straight line

*爱你&永不变心* 提交于 2019-12-24 07:59:23
问题 I'm using the PHP class TCPDF's writeHTML method for creating a PDF document. It works great and seems to cover what I need, but when I try to create multiple images in a straight line using HTML elements in a sequence the images are not rendered in the straight line that I expect. Instead, the position of every sequential image is increased (or decreased in some cases) by a few pixels on the y axis, hence making the sequence of images look like a "staircase": What I expect (every x is a

saving file generated by TCPDF

 ̄綄美尐妖づ 提交于 2019-12-24 02:58:10
问题 I'd like to generate and open PDF when user clicks on a button. Here is my code so far: index.php: </html> <head> <script> $('.cmd_butt').click(function() { $.ajax({ url: 'create_pdf.php', data: {id: $(this).attr('order_id'), name: $(this).attr('name')}, type: 'post' }); } </script> </head> <body> <button class="cmd_butt" order_id="250" name="pdf_but">Download PDF</button> </body> </html> create_pdf.php: <?php //header('Content-type: application/pdf') header("Content-type: application

TCPDF Qr code resize on small size page

删除回忆录丶 提交于 2019-12-24 00:55:58
问题 I use this code for create a 80x30 mm pdf file with a 25x25 mm qrcode: I change the qrcode width and height but it doesn't resize and I always see a little qrcode into the page. Where is the error?? Please help me... I can't undertand the problem! :) <?php require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document $pdf = new TCPDF("L", "mm", array(80,30) , true, 'UTF-8', false); //set margins $pdf->SetMargins(0, PDF_MARGIN_TOP, 0); $pdf->SetHeaderMargin(0

TCPDF - How do I extract pages form a PDF?

半世苍凉 提交于 2019-12-23 14:04:11
问题 I read somewhere that TCPDF was capable of splitting a PDF into individual pages or images. But there's no mention of this in the documentation or an example of how to do it. Can anyone shed some light on this and if it does't recommend a PHP based one I could use to achieve this. I'm trying to split a large PDF into high res images. 回答1: AFAIK this is not possible with pure TCPDF - you can combine it with fpdi (V 1.2.1 and up!) to achieve this. Other option to do what you want (with

TCPDF return to previous page after print dialog close

强颜欢笑 提交于 2019-12-23 12:49:56
问题 I am using TCPDF to generate documents for an online application. I want the user to return to the form after print because the user will capture data again. I have tried opening the pdf in a new tab / window and calling window.close() after print, but to use window.close() the form must open using window.open() which is not the case. Form action opens the window. I have then tried to open the form in the same tab and calling history.back() , but also not working (by not working I refer to

How to remove line below header and above $html in TCPDF?

限于喜欢 提交于 2019-12-23 10:07:02
问题 How to remove line below header and above $html in TCPDF? http://www.tcpdf.org/examples/example_001.pdf tcpdf.org/examples.php (examples with PDF ang PHP code!) in this example this is line below http://www.tcpdf.org and above Welcome to TCPDF. How can i remove this? 回答1: As shown on the tcpdf website - examples in exemple 002 there is no header and here is the php code example. The "magic" is done by this code: // remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter

TCPDF creates damaged pdf

守給你的承諾、 提交于 2019-12-23 06:07:26
问题 TCPDF keeps creating a damaged pdf that I an unable to open. any solutions? I am posting from an html form. I am unsure if my code is wrong but I tested tcpdf's examples and they work fine. This is my php: ob_start(); require_once('tcpdf.php'); $pdf = & new TCPDF("P","mm","A4",true,"UTF-8",false); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetAutoPageBreak(false); $pdf->SetMargins(15,20,15); $pdf->AddPage(); $pdf->SetFont('helvetica','B',12); $pdf->SetFillColor(255,255

Can I use “old-style” (non-lining) numerals in TCPDF?

心不动则不痛 提交于 2019-12-23 05:49:11
问题 Unicode does not distinguish between lining figures (which have the same proportions as capital letters, and are useful in tables, but stand out in running text) and non-lining figures, which look more like lowercase letters, with ascenders and descenders, as it considers them variants of each other. Many fonts, though, have both sets of digits, and provide a way to choose between them. Is there any way to achieve this in TCPDF? Ideally, I would like numbered lists to use lining figures, and

Merge existing PDF with dynamically generated PDF using TCPDF

血红的双手。 提交于 2019-12-22 10:59:44
问题 I am generating a PDF document using TCPDF. My requirement is to merge an existing PDF content at the last page of the dynamically generated PDF. 回答1: By far the best solution to your problem is to use FPDI . https://github.com/Setasign/FPDI The way it works is that FPDI extends TCPDF so you can work with an FPDI object using all of the methods that you're used to using with TCPDF , but with the additional methods that you need to import pages from existing PDF files ( setSourceFile ,