wkhtmltopdf

rails 3 and PDFkit

[亡魂溺海] 提交于 2019-11-28 02:00:29
问题 I'm trying to follow this tutorial. When I'm adding .pdf to my url it does nothing. My controller has: respond_to :html, :pdf. My mime type has been declared. I tried this too: respond_to do |format| format.html format.pdf { html = render_to_string(:layout => false , :action => "www.google.fr") kit = PDFKit.new(html) send_data(kit.to_pdf, :filename => "candidats.pdf", :type => 'application/pdf') return # to avoid double render call } end but it does not work and I don't get errors. My browser

How to convert a simple html to pdf using wkhtmltopdf? [closed]

ぐ巨炮叔叔 提交于 2019-11-28 00:33:41
问题 Here is what I did: Created a linux virtual machine in the Amazon cloud. Followed the instructions from https://code.google.com/p/wkhtmltopdf/wiki/compilation to download and compile the source code of wkhtmltopdf-qt and of wkhtmltopdf. In the end I have a static build of wkhtmltopdf. Took this html (http://jsfiddle.net/mark69_fnd/8CtjB/): <html> <head> <style type="text/css">p{font-family: sans-serif;};</style> </head> <body> <p>Let's Test</p> </body> </html> Ran wkhtmltopdf test.html test

HTML2PDF in PHP - convert utilities & scripts - examples & demos

人盡茶涼 提交于 2019-11-27 23:15:43
I have a quite complicated HTML/CSS layout which I would like to convert to PDF on my server. I already have tryed DOMPDF, unfortunately it did not convert the HTML with correct layout. I have considered HTMLDOC but I have heard that it ignores CSS to a large extent, so I suppose the layout would break apart with that tool too. My question therefor is - are there any online demos for other tools (like wkhtmltopdf i.e.) that I could use to verify how my HTML is converted? Before spending the rest of my life installing & testing one by one? Unfortunately, I can't change the HTML layout to fit

PDFkit hangs when generating a pdf with an image

此生再无相见时 提交于 2019-11-27 19:32:00
问题 I want to render a webpage as a PDF. It uses a single image, and I've read that you need to supply the absolute URL for PDFkit to be able to use the image, so my code is: = image_tag image_url(user.avatar) This works when viewed as HTML, and PDFkit is able to generate a PDF with the image removed. However, when using the image, it just hangs until I kill the server. How can I get this to work? Here's the full output when I kill the server: 2013-12-04 13:53:36.576 wkhtmltopdf[27410:507]

Execute command line via php?

半世苍凉 提交于 2019-11-27 18:19:55
问题 How I can execute those two command line via php: wkhtmltopdf www.google.com gg.pdf & oofice -headless -nologo -pt cup-pdf my.doc they both return a pdf file and download into my home directory. I want to know the way to execute those command from my html page via php. Thanks. 回答1: You should take a look at the System program execution section of the manual : PHP provides several functions that can be used to launch external commands / programs, including : exec() -- which can store the

Wkhtmltopdf fails to printing SVG path (highchart)

江枫思渺然 提交于 2019-11-27 18:09:19
问题 I am trying to create a PDF from a JS highchart chart, like this one: http://www.highcharts.com/stock/demo/ It needs JS delay so wkhtmltopdf --javascript-delay 1000 http://www.highcharts.com/stock/demo/ pdftest1.pdf In the result I see only a grey thick line. I'm using the version 0.11.0 rc2 of the component on Windows 7. Is anyone else experiencing the same issues? 回答1: Here a workaround. The trick is to set plotOptions.series.enableMouseTracking to false. This because the gray line is the

Why does PDFKit/wkhtmltopdf hang but renders PDF as expected when Rails app is killed?

二次信任 提交于 2019-11-27 17:31:21
Background After reading around it seemed to me that Prawn is out and wkhtmltopdf is in. It also seems like the PDFKit and wicked_pdf gems for Rails are the new cool. So I found a screencast by Ryan on how to use PDFKit . I installed everything, tested wkhtmltopdf on the CLI with no problems, fiddled around with Rails settingsto run multiple processes so the asset pipeline works, and all seemed good, except I'm still stuck at the very end of the process (actually getting the PDF response from the server). Question When I request a .pdf version of my view (I'm using the PDFKit Middleware option

How to use wkhtmltopdf.exe in ASP.net [duplicate]

Deadly 提交于 2019-11-27 17:23:54
This question already has an answer here: Calling wkhtmltopdf to generate PDF from HTML 11 answers After 10 hours and trying 4 other HTML to PDF tools I'm about ready to explode. wkhtmltopdf sounds like an excellent solution...the problem is that I can't execute a process with enough permissions from asp.net so... Process.Start("wkhtmltopdf.exe","http://www.google.com google.pdf"); starts but doesn't do anything. Is there an easy way to either: -a) allow asp.net to start processes (that can actually do something) or -b) compile/wrap/whatever wkhtmltopdf.exe into somthing I can use from C# like

Convert HTML into PDF using Python

萝らか妹 提交于 2019-11-27 17:00:21
问题 I am trying to convert HTML into a PDF document in Django and haven't been successful. I have tried using wkhtmltopdf 0.9.9, however Apache throws an error that wkhtmltopdf cannot connect to server. When I use wkhtmltopdf directly, it runs perfectly fine and converts the HTML into a PDF document. I have also tried using unoconv, however the rendered PDF file doesn't have any CSS applied to it. I have also tried using xhtml2pdf. Again I am facing same issue; the rendered PDF file doesn't have

Mixing page orientations in wkhtmltopdf

两盒软妹~` 提交于 2019-11-27 16:02:46
问题 I'm using wkhtmltopdf to produce a PDF from a single HTML file, formatted into separate pages using page-break-before: always . For example: <div class="cover"> Cover Page </div> <div class="page"> Page 1 </div> <div class="page"> Page 2 </div> With CSS: .page { page-break-before: always; } Right now, I have the wkhtmltopdf command written to print the PDF in portrait orientation on letter-size pages. I need one of the pages to be in landscape orientation and the rest to be in portrait