wkhtmltopdf

Why does my Odoo 9 custom Qweb report with CSS is not working?

谁说我不能喝 提交于 2020-01-07 04:18:07
问题 I'm creating a new report on Odoo 9 which uses css styles in order to position text over a background image. The image is in background and occupies the full A4 page without any margins. In html, it's working fine. However, when I print the report to PDF, I have blank margins at left and right, and the text goes below the background image. It seems that the CSS rules are not applied. Do you find any solution for making it working in PDF? Here is my report: <template id="sub_proposal"> <style

mvc action not being called from Rotativa PartialViewAsPdf

浪子不回头ぞ 提交于 2020-01-06 19:33:38
问题 I am using Rotativa (version 1.6.3) to generate pdf from my view. I have a simple partial view(_OverallResultPrintVersion.cshtml): @Styles.Render("~/bundles/css") <img src="@Url.Action("DrawChart", "Vote", new {area = "Award"})"/> In my action when returning Rotativa PartialViewAsPdf, it opens an empty pdf page and the "DrawChart" action won't be called as expected. Here is how I implemented My actions in Vote controller: public ActionResult OverallResultPdf() { return new Rotativa

How do I install wkhtmltopdf with the PHP bindings on Linux (centos)

拟墨画扇 提交于 2020-01-06 08:47:08
问题 How do I install wkhtmltopdf with the PHP bindings on Linux (centos 5+)? My question is slightly different to the other questions because I need help setting up the php bindings as well. Thanks Jason 回答1: Here is a simpler method to programmatically invoke wkhtmltopdf: http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp PHP bindings are really overkill for this applicaiton. In the majority of cases you can get away with just executing it: exec("wkhtmltopdf http://example.org/ pdf1

wkhtmltopdf writes in apache error log for every pdf created

China☆狼群 提交于 2020-01-06 03:31:07
问题 Every time a PDF is created in WKHTMLTOPDF (using php) i am getting the following in the apache error log: Loading pages (1/6) [> ] 0% [======> ] 10% [==========> ] 17% [===================> ] 32% [==============================> ] 50% [=====================================> ] 63% [============================================> ] 74% [============================================================] 100% Counting pages (2/6) [============================================================] Object 1

How do I set header and footer in a PDF, from HTML, with knp-snappy-bundle?

≯℡__Kan透↙ 提交于 2020-01-05 07:42:28
问题 Long story short With knp-snappy-bundle I can't generate a header in the PDF, while I can actually generate a footer. Is it a bug, a feature, or I'm doing something wrong? Details 1. Environment I'm testing the knp-snappy-bundle , I've also installed the wkhtmltopdf binary from h4cc . This is part of my composer.json : "h4cc/wkhtmltopdf-amd64": "^0.12.3", "knplabs/knp-snappy-bundle": "^1.5", The resulting binary of wkhtmltopdf says this: $ vendor/bin/wkhtmltopdf-amd64 --version wkhtmltopdf 0

How do I set header and footer in a PDF, from HTML, with knp-snappy-bundle?

只愿长相守 提交于 2020-01-05 07:41:29
问题 Long story short With knp-snappy-bundle I can't generate a header in the PDF, while I can actually generate a footer. Is it a bug, a feature, or I'm doing something wrong? Details 1. Environment I'm testing the knp-snappy-bundle , I've also installed the wkhtmltopdf binary from h4cc . This is part of my composer.json : "h4cc/wkhtmltopdf-amd64": "^0.12.3", "knplabs/knp-snappy-bundle": "^1.5", The resulting binary of wkhtmltopdf says this: $ vendor/bin/wkhtmltopdf-amd64 --version wkhtmltopdf 0

wkhtmltopdf custom font letter spacing

杀马特。学长 韩版系。学妹 提交于 2020-01-04 14:02:53
问题 I'm running wkhtmltopdf on linux server (centos.10.x86_64). I'm trying to add "Times New Roman" font to the page. I see the fonts but on some font sizes it adds spaces between the letters . I tried setting the font by installing it on the machine (ttf) or by calling an external odf that I converted from the ttf or by adding it with base64 (css). It looks good on all, but it inserts spaces between the laters. I also tried to the dpi parameter but still the spaces are generated. Generating the

Does wkhtmltopdf respect css font color?

爷,独闯天下 提交于 2020-01-04 05:21:51
问题 I'm using wkhtmltopdf to generate a pdf of a page but it doesn't display any of the fonts in the correct colour, they all are presented black. The colour is defined as you'd expect: .panel-dashboard p.stat { color: #bed000; } and displays correctly when viewed in the browser. I'm calling it as wkhtmltopdf path/to/page filename Does wkhtmltopdf just not render font colours correctly? I've not been able to find any issues relating to this. 回答1: Appears this was a problem with wkhtmltopdf 0.9.9,

Google Charts not working with Wkhtmltopdf

拥有回忆 提交于 2020-01-03 09:09:11
问题 I am trying to generate multiple charts in a PDF using Google Charts. For the PDFs, I am using CakePDF with the Wkhtmltopdf engine. I appear to be having a problem with actually loading the Google Chart code into the PDF though. This is my current code for my Javascript. <script type="text/javascript" src="https://www.google.com/jsapi"> </script> <script type="text/javascript"> google.load('visualization', '1.0', {'packages':['corechart']}); //setTimeout(function() {google.load('visualization

Use wkhtmltopdf to set landscape orientation

那年仲夏 提交于 2020-01-03 06:48:07
问题 How I can change the orientation of my pdf file which is generated with Wkhtmltopdf . I invoke it in PHP like following: $file = fopen("tmp/html/pdfTmp_$numRand.html", "w") or exit("Unable to open file!"); fwrite($file, $html); fclose($file); exec("..\library\wkhtmltopdf\wkhtmltopdf " . "tmp/html/pdfTmp_$numRand.html tmp/pdf/pdfTmp_$numRand.pdf"); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header("Content-Disposition: attachment; filename="