wkhtmltopdf

WickedPDF missing layout

怎甘沉沦 提交于 2019-12-07 04:10:02
问题 I have a controller like this: def show @professor = Professor.find(params[:id]) respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end end And a simple view like this: <p>Professor: <%= @professor.first_name %></p> <p>Email: <%= @professor.email if @professor.email %></p> I also have a layout 'application.html.erb'; <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content=

wkhtmltopdf relative paths in HTML with redirected in/out streams won't work

笑着哭i 提交于 2019-12-07 03:18:25
问题 I am using wkhtmltopdf.exe (version 0.12.0 final) to generate pdf files from html files, I do this with .NET C# My problem is getting javascript, stylesheets and images to work by only specifying relative paths in the html. Right now I have it working if I use absolute paths. But it doesn't work with relative paths, which makes the whole html generation a bit to complicated. I have boiled what I do down to the following example: string CMDPATH = @"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf

wkhtmltopdf - same configuration different output

帅比萌擦擦* 提交于 2019-12-07 02:47:04
问题 I'm using wkhtmltopdf through snappy in my project. On my local machine the output is correct: https://www.dropbox.com/s/ml9cp2pa6d8wja5/Zaznaczenie_100.png?dl=0 but when I deploy the project to the server the pdf is looking very different, probably the width of viewport is different: https://www.dropbox.com/s/8g0c29bzaxltyb9/170311_123139_4775.jpg?dl=0 Both systems use exactly the same configuration for generating the pdf. My questions are: how can I check what is the default configuration

wkhtmltopdf automatic page breaks

烈酒焚心 提交于 2019-12-07 01:03:19
问题 I'm using wkhtmltopdf v0.11.0 rc1 in a Rails application through wicked_pdf (I know wicked_pdf does not support the new command line parameter notation, I'm using my own fork of the gem). I thought that content not fitting within a page should automatically overflow to the next one, but this is not the case - I'm seeing text just being cut off, sometimes in the middle of a line. I know I can layout my pages using page-break-after:always , but this looks like dirty hard-coding, and besides the

How to deal with ContentNotFoundError when using wkhtmltopdf?

心已入冬 提交于 2019-12-06 21:55:20
问题 Can someone tell me how to resolve following issues? wkhtmltopdf don't have option to pass proxy info (-p or --proxy) unlike in previous versions and its not using system $http_proxy and $https_proxy env variable too. wkhtmltopdf not working with HTTPS/SSL even though i set LD_LIBRARY_PATH for libssl.so and libcrypto.so [deploy@localhost ~]$ wkhtmltopdf https://www.google.co.in google.pdf loaded the Generic plugin Loading page (1/2) Error: Failed loading page https://www.google.co.in

How to link stylesheet files to pdfkit in Flask application?

怎甘沉沦 提交于 2019-12-06 13:32:28
问题 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

Using wkhtmltopdf with highcharts shows blank chart

强颜欢笑 提交于 2019-12-06 13:24:50
I'm attempting to use wkhtmltopdf via Rotativa to convert a basic html page which uses jquery and highcharts to render a demo chart. The chart renders correctly when displayed in a browser. Can anyone tell me what I'm doing wrong? This code results in a blank PDF. My view: <!DOCTYPE html> <html> <head> <title>Highcharts Test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> #chart { float:left; width:300px; height:300px; } </style> <script src="//ajax.googleapis.com/ajax

Unable to print Check Boxes in pdf

女生的网名这么多〃 提交于 2019-12-06 12:41:37
问题 We are using WkHtmlToPdf to convert from html to pdf. Now I have make all the form fields editable on request as well. Since there is a bug in WkHtmlToPdf while converting Html to Pdf it makes all the form field's property as Visible Not Printable. To get around this problem we are using ITextSharp to read existing pdf that has been generated by WkHtmlToPdf and setting that property as Visible for every form field. This is how I am doing that var pdfReader = new PdfReader(inputFilename);

wkhtmltopdf repeatitive background image on all pages

点点圈 提交于 2019-12-06 12:26:59
问题 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

wkhtmltopdf with javascript-delay not working

China☆狼群 提交于 2019-12-06 12:13:08
The pdf that is created using the code below hasn't finished rendering the javascript so javascript was preformed on half of the tables (say if there are 100 tables then sometimes 50 are done, other times 52, 54 etc). I'm using the flag --javascript-delay 40000 in trying to delay the retrievement of the page but the results are the same. It's still pulling the trigger too fast. I know this is the issue because when I use the browser everything works correctly. How can I set the delay properly? Maybe shell_exec is at fault here? $command = shell_exec("xvfb-run -a -s '-screen 0 640x480x16'