wkhtmltopdf

letter-spacing is too large with wkhtmltopdf

Deadly 提交于 2019-12-05 01:00:51
问题 I'm using wkhtmltopdf to download a webpage as pdf. But the css property letter-spacing seems doesn't work font-size:20px; letter-spacing:0px; font-size:20px; letter-spacing:1px; The spacing is very large for 1px... I tried with 2 differents font-family 回答1: Its a known issue. https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1575 . No fix for it. Only to avoid using letter-spacing 回答2: Issue every one face with letter spacing, perfect solution is here. import pdfkit #SnippetBucket.com code

Highcharts charts on a page not rendering correctly when output to PDF using wkhtmltopdf

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 19:31:53
My wkhtmltopdf PDF output of a page with several Highcharts charts on it is missing some elements of the charts, primarily all of the simple straight lines, including tick marks, grid lines, column borders, legend borders and the lines in my line/spline charts (data points display). I have tried the tricks used to solve this issue from other stack questions, namely setting all of the following on the series: enableMouseTracking: false, shadow: false, animation: false ...as well as setting those on the column/spline. No luck. Here is a link to an image of the browser page . Here is a link to an

wkhtmltopdf repeatitive background image on all pages

被刻印的时光 ゝ 提交于 2019-12-04 19:29:12
I am struggling to make a repetitive background for a generated PDF. I have a certificate that is automatically generated and certificate design has a frame that should repeat on all the pages... I tried .main_container{ background: url({{ resourceDir ~ 'img/certificate_margin.jpg' }}) 0 0; padding-top:15px; z-index: 99; background-size: cover; width:658px; height:975px; } but after the first page is displayed I only get the content and a white page. Did anyone managed to solve this issue some how? Or is it even possible to do it? my config file: knp_snappy: pdf: enabled: true binary: "

Problems serving a binary image passed through stdout with Node

倾然丶 夕夏残阳落幕 提交于 2019-12-04 19:09:45
I'm attempting to create a node server that serves up a png image generated using the node-wkhtml module (basically just a wrapper for the wkhtmltoimage/wkhtmltopdf command line utility). Here's what I have so far: var http = require('http'); var Image = require("node-wkhtml").image(); http.createServer(function (request, response) { new Image({ url: "www.google.com" }).convert (function (err, stdout) { //var theImage = new Buffer (stdout, 'binary'); response.writeHead(200, {'Content-Type' : 'image/png', 'Content-Length' : stdout.length }); response.write (stdout, 'binary'); response.end (); /

node wkhtmltopdf create corrupted PDF in node webkit

不问归期 提交于 2019-12-04 18:42:26
Im having a lot of trouble in node webkit to convert html to PDF. Im using wkhtmltopdf 0.12.1 and did the npm install wkhtmltopdf. Here is my node code: var wkhtmltopdf = require('wkhtmltopdf'); var fs = require("fs-plus"); // URL wkhtmltopdf('http://google.com/', { pageSize: 'letter' }) .pipe(fs.createWriteStream('out.pdf')); It gave me an error. Later I found this https://github.com/devongovett/node-wkhtmltopdf/pull/9 I did the correcting and im not getting any error anymore but the PDF that I get in return is corrupted . Any idea ? I have tried following the examples on the node-wkhtmltopdf

How to link stylesheet files to pdfkit in Flask application?

你说的曾经没有我的故事 提交于 2019-12-04 18:11:44
I am trying to create pdf from html page using pdfkit inside Flask application, but I have troubles to load the static files (stylesheets) when using pdfkit . I've tried to come up with minimal example. I've got this file structure App |_ static | |- style.css |_ templates | |- base.html |_ pdfs | |- file.pdf |_ application.py Inside application.py : import flask import pdfkit app = flask.Flask(__name__) @app.route('/') def index(): page = flask.render_template('base.html') pdfkit.from_string(page, 'pdfs/file.pdf') return page @app.route('/download', methods=['POST']) def download(): if flask

How to install phpwkhtmltopdf

江枫思渺然 提交于 2019-12-04 18:03:00
I am trying to install phpwkhtmltopdf on shared server (webhotel). The server has already composer installed, and I have SSH to server. But I am not too familiar with composer so I might be doing someting very basic wrong here.. So, I have downloaded the zip file from: https://github.com/mikehaertl/phpwkhtmltopdf and extracted the files on it to server to directory named as phpwkhtmltopdf. Then, opening SSH cd-ing to that dir and running composer require mikehaertl/phpwkhtmltopdf but I only get question marks to beginning of line. For the question marks I read that it could be a problem of

Getting PDF from WickedPDF for attachment via Carrierwave

大城市里の小女人 提交于 2019-12-04 16:31:34
问题 In Rails3, I am using the WickedPDF gem to render a PDF format of one of my models. This is working fine: /invoices/123 returns HTML, /invoices/123.pdf downloads a PDF. In my Invoice model, I am using the state_machine gem to keep track of Invoice status. When an invoice goes from "unbilled" to "billed" state, I would like to grab a copy of the invoice PDF and attach it to the invoice model using CarrierWave. I have the three parts working separately: the controller creates a PDF view, the

wkhtmltopdf codeigniter

╄→尐↘猪︶ㄣ 提交于 2019-12-04 15:46:43
问题 wkhtmltopdf sounds like an excellent solution...the problem is nothing happens on the exec shell_exec("c:\wkhtmltopdf.exe","http://www.google.com google.pdf"); Am i doing anything wrong? 回答1: Can you use the "official" class? http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp If not, perhaps peeking into how they did things will help you out with your implementation. // Include WKPDF class. require_once('wkhtmltopdf/wkhtmltopdf.php'); // Create PDF object. $pdf = new WKPDF(); // Set

wkhtmltopdf css sizes in cm/mm

柔情痞子 提交于 2019-12-04 15:41:26
问题 I use wkhtmltopdf to produce A4 sized PDFs. When I create a <div> tag and set its style to height: 297mm; width: 210mm (which is the defined size of A4), set wkhtmltopdf's margin settings to 0 ( wkhtmltopdf -B 0 -T 0 -L 0 -R 0 ... ) and give the <div> a red background, I can see a thin white line at the bottom of the page, i.e. the <div> is not filling the page completely. This is happening consistently with 0.11.0 rc1 (the latest version) on Debian and with 0.10.0 rc2 on Mac OS X. Has anyone