wkhtmltopdf

Why doesn't wkhtmltopdf page-break-after have any effect?

别说谁变了你拦得住时间么 提交于 2019-12-03 02:36:49
问题 I'm using wkhtmltopdf 0.10.0 rc2 for Mac I have an html like this one : <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link href="print.css" rel="stylesheet"> <style type="text/css" media="screen,print"> .break{ display: block; clear: both; page-break-after: always; border :1px solid red } .page-breaker { display: block; page-break-after: always; border :1px solid red } </style> </head> <body> <div class="container break"> page 1 </div> <div class="page-breaker"></div> <div

wkhtmltopdf repeating thead headers overlapping content

落爺英雄遲暮 提交于 2019-12-03 02:21:47
问题 We're embedding wkhtmltopdf (0.12.1) in a Java application, using stdin and stdout for input/output. We want multiple (different) headers in our PDF, so instead of using the --header-html option we're using a thead , which is repeated on several pages. Here's a little example HTML: <!DOCTYPE html> <html> <body> <table style="page-break-after: always;"> <thead> <tr> <th>My first header</th> </tr> </thead> <tbody> <tr> <td>First content</td> </tr> </tbody> </table> <table> <thead> <tr> <th>My

Error running wkhtmltopdf — (error while loading shared libraries)

爱⌒轻易说出口 提交于 2019-12-03 00:54:37
When my app runs (or when I run from commandline) the wkhtmltopdf command I get the following error: (showing it from command line) #> wkhtmltopdf wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory I noticed the lib is indeed in the /usr/lib folder but not the /lib folder. Does it matter which one of these it is in? Is there any way to get it to recognize it? #> ls -l /usr/lib/libXrender.so* lrwxrwxrwx 1 root root 19 Feb 17 07:20 /usr/lib/libXrender.so -> libXrender.so.1.3.0 lrwxrwxrwx 1 root root 19 Feb 17 07:20 /usr

Fix wkhtmltopdf headers clipping content?

浪尽此生 提交于 2019-12-02 22:45:29
My headers often clip content so that the content below it is not completely visible, it appears as though the page continues underneath the header before the header ends and as a result, not all of the content is shown. Is there a CSS rule I can use for this? Or a cmd argument for wkhtmltopdf? Or any other way? I have learned that this is actually a known issue and is unlikely to be changed in a while. The workaround is to use style="margin:0; padding:0;" in the header <body> element. Another workaround would be to experiment with the --header-spacing n parameter. Yet another way is to wrap

wkhtmltopdf 协助后端导出复杂pdf文件的第三方软件(2)

风格不统一 提交于 2019-12-02 21:43:03
(1)术语定义 文档对象 “文档对象”是指PDF文档中的文档对象,共有三种类型的“文档对象”,他们分别是“页面对象”,“封面对象”和“目录对象”。 页面对象 “页面对象”是指以页面的形式在PDF文档中呈现的对象,这个是相对于“封面对象”和“目录对象”来讲的。此类对象会成为PDF文档中内容。 封面对象 “封面对象”是指以封面的形式在PDF文档中呈现的对象。这类对象会成为PDF文档中的封面。 目录对象 “目录对象”是以目录的形式在PDF文档中呈现的对象,又叫“TOC对象”。这类对象会成为PDF文档中的目录。 大纲 “大纲”是指阅读PDF文档时的书签导航。 外链 “外链”是指所有在这个页面中且不指向它自身页面中锚点的超链接。 内链 “内链”是指在这个页面中且指向的目标页面是这个页面本身中的一个锚点的超链接。 (2)命令格式 wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file> 上述代码就是 wkhtmltopdf 的命令行格式,看似简单,其实在 [GLOBAL OPTION] 和 [OBJECT] 中还别有洞天。预知详情,且听我慢慢道来。 (3)参数 常规选项 –allow <path> 允许加载从指定的文件夹中的文件或文件(可重复) –book* 设置一会打印一本书的时候,通常设置的选项 –collate 打印多份副本时整理

WKHTMLTOPDF Installation error on Ubuntu

点点圈 提交于 2019-12-02 19:27:55
We require features like header, footer, table of contents and cover page of pdf, which we want to generate from html/css. We tried WKHTML on windows and it worked like a charm, when moving to our server, we installed WKHTML on our ubuntu server, installation process was successful but it had only limited features, it was able to generate pdf from HTML but all features mentioned (i-e header, footer , table of content and cover page) wasn't working. Following is the error which it was producing. "The switch -t, is not support using unpatched qt, and will be ignored. Error: This version of

Why doesn't wkhtmltopdf page-break-after have any effect?

◇◆丶佛笑我妖孽 提交于 2019-12-02 16:10:09
I'm using wkhtmltopdf 0.10.0 rc2 for Mac I have an html like this one : <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link href="print.css" rel="stylesheet"> <style type="text/css" media="screen,print"> .break{ display: block; clear: both; page-break-after: always; border :1px solid red } .page-breaker { display: block; page-break-after: always; border :1px solid red } </style> </head> <body> <div class="container break"> page 1 </div> <div class="page-breaker"></div> <div class="container"> page 2 </div> </body> </html> I simply try : wkhtmltopdf test.html test.pdf But it

wkhtmltopdf repeating thead headers overlapping content

时光总嘲笑我的痴心妄想 提交于 2019-12-02 15:53:12
We're embedding wkhtmltopdf (0.12.1) in a Java application, using stdin and stdout for input/output. We want multiple (different) headers in our PDF, so instead of using the --header-html option we're using a thead , which is repeated on several pages. Here's a little example HTML: <!DOCTYPE html> <html> <body> <table style="page-break-after: always;"> <thead> <tr> <th>My first header</th> </tr> </thead> <tbody> <tr> <td>First content</td> </tr> </tbody> </table> <table> <thead> <tr> <th>My second header</th> </tr> </thead> <tbody> <tr> <td>Second content</td> </tr> </tbody> </table> </body> <

How to print pdf in debian linux from MVC controller

家住魔仙堡 提交于 2019-12-02 10:24:40
AsP.NET MVC 4 application runs in Debian Squeeze Linux using Mono. Controller creates pdf file from html using code below. How to print pdf file to Samsung printer connected to server ? It there some executable which can used for this ? public class Test: Controller { public ActionResult Print() { PrintOrderVormiga(); return new ContentResult() { Content = "OK" }; } void PrintOrderVormiga() { StringBuilder sb = new StringBuilder(); sb.Insert(0, " test ", 500); pdf = ConvertHtmlToPDF("<html><body>" +sb.Tostring()+ "</body></html>"); var doc = new PrintDocument(); doc.PrinterSettings.PrinterName

How to stop wkhtmltopdf.exe pop-up while running it with Python

本小妞迷上赌 提交于 2019-12-02 10:05:28
I am using wkhtmltopdf.exe for converting html to pdf using python. The pop-up window of wkhtmltopdf.exe making it very difficult for me to work on any other things while running it. I have to convert around 200K+ files and have to work on something else simultaneously. But its really not letting me to work on anything else. Is there a way of stopping this or running it in background? I really appreciate your help. PS. Sorry I am new to it, don't know any other way to stop it. I am using wkhtmltox-0.12.2.2_msvc2013-win64 software So I solved the problem! made my python file executable using