wkhtmltopdf

python生成pdf报告、python实现html转换为pdf报告[python3]

北战南征 提交于 2019-11-30 18:01:32
centos 6.10 import pdfkit pdfkit.from_url('http://google.com','out.pdf') pdfkit.from_file('test.html','out.pdf') pdfkit.from_string('Hello!','out.pdf') 系统安装wkhtmltopdf:参考 https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf 安装wkhtmltox 需要安装以下两个系统包 xorg-x11-fonts-75dpi is needed by wkhtmltox-1:0.12.5-1.centos6.x86_64 xorg-x11-fonts-Type1 is needed by wkhtmltox-1:0.12.5-1.centos6.x86_64 效果不太好 来源: https://my.oschina.net/u/3371661/blog/3113572

wkhtmltopdf patched qt?

北城以北 提交于 2019-11-30 17:58:58
I'm trying to convert multiple URLs to PDF. However, when I compile wkhtmltopdf or run apt-get install wkhtmltopdf and try, it says: Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document. If I use the static version, I get Segmentation fault error. How do I build wkhtmltopdf against a patched version of QT, or are there any other solutions besides converting one by one and reuniting? My OS is Ubuntu 12.04 64-bit. Thanks. m3rg First check out the source git clone git://gitorious.org/~antialize/qt/antializes-qt.git

Internal links with wkhtmltopdf?

一个人想着一个人 提交于 2019-11-30 17:23:54
I have created a PDF from several web pages using wkhtmltopdf. Is there a way to link across pages, for example from page 10 to 15. I tried creating an element with an ID and then an anchor to link to it, but this does not work within the same page or across pages. It turns the link into an absolute URL and tries to open it in a web browser. I solved this issue by updating the binary that I was using. I was using 0.8 and switched to 0.11.0 rc1. Ensure that it is built against QT (the latest binary at http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltoimage-0.11.0_rc1-static

wkhtmltopdf.exe System.Security.SecurityException on cloud web server. How can i override server security policy

随声附和 提交于 2019-11-30 15:22:56
I want to have a feature for my website which can print the page contents as PDF. I tried a few option for this but the best match was wkhtmltopdf as it also handle multilingual characters. I got it working on my local server but when I uploaded it on a cloud web server for hosting now it is giving me the following error Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

generating pdf hangs on rails 4 using PDFkit gem

筅森魡賤 提交于 2019-11-30 15:07:35
问题 I'm able to download pdf file with: curl google.com | wkhtmltopdf - test.pdf so it means, wkhtmlpdf installation was successful. But, when I try to generate pdf file by accessing http://localhost:3000/contacts/1.pdf it hangs. In the status bar it shows: Waiting for localhost... Rails server output: Started GET "/contacts/1.pdf" for 127.0.0.1 at 2013-07-28 21:45:06 +0900 ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by

How to pipe InputStream to ProcessBuilder

眉间皱痕 提交于 2019-11-30 13:47:53
Please move down to the 2nd update. I didn't want to change the previous context of this question. I'm using wkhtmltoimage from a Java app. The standard way of using it is - path-to-exe http://url.com/ image.png . According to their docs, if we write a - instead of an input URL, the input shifts to STDIN. I'm starting the process using ProcessBuilder - ProcessBuilder pb = new ProcessBuilder(exe_path, " - ", image_save_path); Process process = pb.start(); Now I'm unable to figure out how to pipe an input stream to this process. I have a template file read into a DataInputStream , and I'm

Jekyll documentation to PDF with TOC

老子叫甜甜 提交于 2019-11-30 13:47:26
问题 I would like to write documentation using Jekyll with HTML and PDF outputs. Html can have a navigation but the PDF should have table of contents. Is there a free and easy way to do that? The HTML part is easy but I would like to use @media print CSS for making the PDF file. I have a few ideas how to do this. Use PrinceXML, unfortunately this is commercial product with a nasty price tag ~$500 Use WKHTMLTOPDF Use Maruku, since it is possible to do a PDF conversion using it I would like to have

Converting Twitter bootstrap page into PDF with wkhtmltopdf : span issue

烈酒焚心 提交于 2019-11-30 11:51:22
问题 I am using Symfony2 Bundle KnpSnappyBundle to convert an html twig template to a pdf. KnpSnappyBundle is base on Snappy wrapper, that use wkhtmltopdf. My template use twitter bootstrap 2.3.2 css like this : <div class="container"> <div class="row"> <div class="span12"> <h4>TITLE</h4> </div> </div> <div class="row"> <div class="span6" id="customers"> <h5>TITLE</h5> <p>TEXT</p> <ul class="unstyled"> <li>LIST ITEM</li> <li>LIST ITEM</li> <li>LIST ITEM</li> <li>LIST ITEM</li> </ul> </div> <div

Debugging javascript in wkhtmltopdf

巧了我就是萌 提交于 2019-11-30 11:04:13
Where I can see the output of javascript debug when wkhtmltopdf runs in debug mode (--debug-javascript) Another (I would say easiest) means of debugging javascript in WKHTMLTOPDF is to download QT Browser, the underlying browser used by WKHTMLTOPDF, and to inspect the javascript execution for your page from within the browser. You can download it from here Instructions on debugging javascript in QT here You can basically debug your JavaScript in QT Browser just as you would in Chrome or Firefox. Rendering test.html <!DOCTYPE html> <html> <head></head> <body> BODY <script> console.log('Hi!'); <

Jekyll documentation to PDF with TOC

痞子三分冷 提交于 2019-11-30 08:45:32
I would like to write documentation using Jekyll with HTML and PDF outputs. Html can have a navigation but the PDF should have table of contents. Is there a free and easy way to do that? The HTML part is easy but I would like to use @media print CSS for making the PDF file. I have a few ideas how to do this. Use PrinceXML , unfortunately this is commercial product with a nasty price tag ~$500 Use WKHTMLTOPDF Use Maruku , since it is possible to do a PDF conversion using it I would like to have multiple pages HTML and single page PDF with a TOC. Any suggestions? Btw. Buildr has solved this