html2pdf

Pisa (XHTML -> PDF) in Django will not display images in PDF

萝らか妹 提交于 2019-12-10 06:18:26
问题 To start, I've seen the other threads on this, and I have tried nearly everything to try to fix this but... When using Pisa to render an HTML page to PDF, the images in said HTML go conspicuously missing. That is to say, when the page is rendered to HTML, everything is just dandy, but when I switch the output to PDF using Pisa, the images disappear. The most common thing I've found to do is to create a link callback function thus: def fetch_resources(uri, rel): path = os.path.join(settings

Execute wkhtmltopdf from PHP

时光怂恿深爱的人放手 提交于 2019-12-09 15:08:36
问题 I have this working fine from Linux command line: wkhtmltopdf entry.html output.pdf But the following doesn't work from PHP code: exec ('wkhtmltopdf entry.html output.pdf'); Interesting, I've googled and a lot of non-checked solutions and with no explanation why this is a problem. Thanks if you have the good ones. 回答1: wkhtmltopdf has bindings, one of them is for PHP. You could give those a shot. 回答2: had the same problem and i don't think anyone else should waste > 3 hours: the solution is

Working with css floats in html2pdf

懵懂的女人 提交于 2019-12-09 08:17:31
问题 I'm using floats to position 2 divs beside each other. <a href="printbox.php">print</a> <?php ob_start(); ?> <style> #sidedish{ float: left; border: 1px solid black; width: 100px; height: 100px; } #maindish{ float: right; width: 200px; border: 1px solid black; height: 100px; text-align: center; } #container{ width: 304px; height: 100px; border: 1px solid black; } </style> <div id="container"> <div id="sidedish"></div> <div id="maindish"><div id="box">name</div></div> </div> <?php $_SESSION[

Why doesn't border-collapse work in html2pdf?

你说的曾经没有我的故事 提交于 2019-12-08 14:32:08
问题 I want to create a pdf with an html table like : So, I created this html : <table style="width: 100%; border:2px solid; border-collapse: collapse; padding: 0; margin: 0;"> <tr style="border-bottom: 1px solid;"> <th style="border-left: 1px solid; width: 60%;">Ref produit</th> <th style="border-left: 1px solid; width: 10%;">Taille</th> <th style="border-left: 1px solid; width: 10%;">Quantit�</th> <th style="border-left: 1px solid; width: 10%;">Prix net HT</th> <th style="border-left: 1px solid;

multiple pdf files with html2pdf

妖精的绣舞 提交于 2019-12-08 10:26:21
问题 I need to create multiple PDF file from a php loop... any ideas on how to do that? I try to use html2pdf but I get a tag error (the include file is working fine beacuse the single output is working!): require_once('html2pdf.class.php'); $results = mysql_query("SELECT * FROM tbl ORDER BY id DESC LIMIT 10"); while ($row = mysql_fetch_assoc($results)) { $id=$row['id']; include('pdf.php'); $content = ob_get_clean(); try { $html2pdf = new HTML2PDF('P', 'A4', 'en', false, 'ISO-8859-1'); $html2pdf-

pdf download html2pdf

旧城冷巷雨未停 提交于 2019-12-08 03:22:23
问题 i am using html2pdf class to generate pdf. in my problem its generate pdf for the html code but it not give the dialog box option to download that pdf. plz help my cose is following. <?php ob_start(); include(dirname(__FILE__).'/res/pdf_demo.php'); $content = ob_get_clean(); // conversion HTML => PDF require_once(dirname(__FILE__).'/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P','A4', 'fr', false, 'ISO-8859-15'); $html2pdf->pdf->SetDisplayMode('fullpage'); $html2pdf->writeHTML(

PHP TCPDF ERROR: Unable to create output file the folder exist and has the right permissions

好久不见. 提交于 2019-12-07 19:34:53
问题 I'm trying to save a pdf file using the html2pdf PHP class. The code is this: $this->html2pdf->Output('directory/file_name.'.pdf', 'F'); But I have alway this error TCPDF ERROR: Unable to create output file the folder 'folder' (the name is an example, obviusly), exist and has the right permissions! I tryed to omit the folder name, but this error appear anyway... Anyone can help me? 回答1: thats because your folder dont have proper permissions.change your directory permissions. in linux you will

jsPDF: html2canvas not loaded while using new .html() method

久未见 提交于 2019-12-06 07:38:33
问题 I want to use jsPDF.html to convert html page to pdf, and I'm using this code: savePdf () { var pdf = new jsPDF({unit: 'mm', format: 'a4', orientation: 'portrait' }) pdf.html(document.getElementById('printable-cv'), { callback: function (pdf) { pdf.save('cv-a4.pdf'); } }) } but I get error html2canvas not loaded : is it something I forgot? I do have html2canvas "html2canvas": "^1.0.0-alpha.12" I'm using vuejs with webpack. In the same page I'm currently using alternatively html2pdf with the

How to get rid of the left and top margins in css when using html2pdf

一笑奈何 提交于 2019-12-06 06:00:49
问题 I'm using html2pdf and I want to get rid of the top and left margins using css but I can't. Before output buffering margin is already set to 0, it works on html but when I convert it to pdf using html2pdf the top and left margins appears again. Here's my current css. body { margin: 0; padding: 0; } #box { margin: 0; padding: 0; width: 803px; height: 1400px; border: 1px solid #000; } Please help. 回答1: I suspect that the margins are generated by html2pdf, not from the html/css. Have you tried

pdf download html2pdf

怎甘沉沦 提交于 2019-12-06 05:17:41
i am using html2pdf class to generate pdf. in my problem its generate pdf for the html code but it not give the dialog box option to download that pdf. plz help my cose is following. <?php ob_start(); include(dirname(__FILE__).'/res/pdf_demo.php'); $content = ob_get_clean(); // conversion HTML => PDF require_once(dirname(__FILE__).'/../html2pdf.class.php'); try { $html2pdf = new HTML2PDF('P','A4', 'fr', false, 'ISO-8859-15'); $html2pdf->pdf->SetDisplayMode('fullpage'); $html2pdf->writeHTML($content, isset($_GET['vuehtml'])); $html2pdf->Output('pdf_demo.pdf'); } catch(HTML2PDF_exception $e) {