wkhtmltopdf

WKHTMLTOPDF — Is possible to display dynamic headers?

倖福魔咒の 提交于 2019-12-02 04:24:10
Im using wkhtmltopdf --header-html option, but it seems, that it really works only with html code. Is there any way I can add some PHP and force it to working somehow? I need to display Date and user´s e-mail on every page... Thanks for any advice ;) You can feed --header-html almost anything :) Try the following to see my point: wkhtmltopdf.exe --margin-top 30mm --header-html isitchristmas.com google.fi x.pdf So isitchristmas.com could be www.yoursite.com/magical/ponies.php Just to add, you cant run the php files locally so you need a webserver to serve them. If you need 100% local dynamic

How to make wkhtmltopdf work in Odoo v10 on Debian 9 “Stretch”?

孤街浪徒 提交于 2019-12-02 04:16:35
I know from the Odoo website that Odoo needs an special wkhtmltopdf version: Danger to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in debian repositories does not support headers and footers so it can not be installed automatically. The recommended version is 0.12.1 and is available on the wkhtmltopdf download page, in the archive section. As there is no official release for Debian Jessie , you can find ours on the extra section of our nightly server. So, it is possible to install the library on Debian Jessie because there is an extraofficial

Printing the current page to pdf using wkhtmltopdf

老子叫甜甜 提交于 2019-12-02 03:02:50
问题 Recently installed wkhtmltopdf. Was trying to capture the entire page in its current state, however, the below method seems to navigate to the initial state of that page without all the input fields that the user has entered. PHP shell_exec('wkhtmltopdf http://localhost/www/bolt/invoice.php invoice.pdf'); I was wondering if someone knew of an implementation of wkhtmltopdf that captures the current state of the page including any text entered in the text fields?? I appreciate any suggestions.

WkHtmlToXSharp - System.AccessViolationException

匆匆过客 提交于 2019-12-01 22:34:19
问题 I'm using the WkHtmlToXSharp wrapper library in my project to generate PDF file from HTML. I was using this library a lot of times in different PCs and, suddenly, I came across the following problem: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at WkHtmlToXSharp.WkHtmlToPdfConverter.wkhtmltopdf_convert(IntPtr converter) at WkHtmlToXSharp.WkHtmlToPdfConverter. Convert(String inputHtml) at WkHtmlToXSharp

How can I get wkhtmltopdf to display th and td background gradients?

帅比萌擦擦* 提交于 2019-12-01 17:02:17
I need to add background gradients to some td and th elements in page which gets converted to PDF, however I'm getting some very strange behavior from wkhtmltopdf, so when I do this: table { width: 100%; border-collapse: collapse; } th { height: 60px; border: 1px solid Black; } td { height: 100px; background: -webkit-linear-gradient(top, #ccc 0%, #888 100%); border: 1px solid Black; } <table> <tr> <th></th> </tr> <tr> <td></td> </tr> <tr> <td></td> </tr> </table> The height of the th seems to encroach on each subsequent td somehow. All is well if I remove the th or set its height to a whole

plotly js: how to run my javascript ONLY after plot image is loaded

旧城冷巷雨未停 提交于 2019-12-01 15:57:54
When using a plotly graph of any sort with the Javascript API (plotly.js, not plotly-nodejs), how can I run some javascript ONLY after the graph has loaded? I'm looking for the mechanism in the plotly javascript API that, for example, does the same thing that 'addListenerOnce', in conjunction with 'tilesloaded' or 'ready', do when using the Google Maps API. For example, let's say I want to simply display an alert immediately after rendering the example shown at https://plot.ly/~PlotBot/685 , for which the html and js code can be seen at https://plot.ly/~PlotBot/685.js . There are many reasons

Chinese characters showing as question marks

大憨熊 提交于 2019-12-01 14:55:17
This has been asked before, but I can't figure out what's wrong. I'm printing pdfs using phantomjs .render() . The rendered page is basically a local static site with these properties: <meta charset="UTF-8"> font: normal 17px helvetica,arial,verdana,sans-serif running and tested on Windows locally and Azure Worker Roles Chinese language pack installed and working when printing the same page from Chrome (Installed fonts e.g. Arial Unicode MS, SimSun ...) Latin characters are all fine, just Chinese ones are displayed as "?" For example I also tried the entire page in Arial or SimSun only, but no

plotly js: how to run my javascript ONLY after plot image is loaded

最后都变了- 提交于 2019-12-01 14:49:04
问题 When using a plotly graph of any sort with the Javascript API (plotly.js, not plotly-nodejs), how can I run some javascript ONLY after the graph has loaded? I'm looking for the mechanism in the plotly javascript API that, for example, does the same thing that 'addListenerOnce', in conjunction with 'tilesloaded' or 'ready', do when using the Google Maps API. For example, let's say I want to simply display an alert immediately after rendering the example shown at https://plot.ly/~PlotBot/685,

WKHTMLTOPDF with pdfkit on Rails ignoring table page breaks

一曲冷凌霜 提交于 2019-12-01 12:56:38
I know there are a lot of issues with wkhtmltopdf and page breaks that date back years, but I haven't worked out a solution yet. I'm using the PDFKit gem to generate my html pages into pdfs, but I don't want the pages to break in the middle of a table row. I'm using wkhtmltopdf-binary (0.9.9.3), which looks to be the most updated version My CSS: @media print { #scores table tr td, #scores table tr th { page-break-inside: avoid !important; } table, tr, td, th, tbody, thead, tfoot { page-break-inside: avoid !important; } } My table: <div class="score_table"> <table id="scores" class="print

Chinese characters showing as question marks

非 Y 不嫁゛ 提交于 2019-12-01 12:10:41
问题 This has been asked before, but I can't figure out what's wrong. I'm printing pdfs using phantomjs .render() . The rendered page is basically a local static site with these properties: <meta charset="UTF-8"> font: normal 17px helvetica,arial,verdana,sans-serif running and tested on Windows locally and Azure Worker Roles Chinese language pack installed and working when printing the same page from Chrome (Installed fonts e.g. Arial Unicode MS, SimSun ...) Latin characters are all fine, just