wkhtmltopdf page-break-after有空格(wkhtmltopdf page-break-after have whitespace)
我使用
WKHTMLTOPDF
从打印机友好的网页生成PDF 。 我从版本0.10.0 rc2升级到0.12.1 (带有修补的qt),但现在我使用CSS
属性,如page-break-before:always;
它插入一堆空格 ,并且page-breake-inside:avoid;
不起作用,这很神奇。我用这个电话:
/usr/local/bin/wkhtmltopdf --encoding 'UTF-8' 'page-to-print' '/tmp/PDFV59OZt'
我曾尝试使用和不使用
--print-media-type
和--no-print-media-type
。当我在浏览器中呈现打印机友好页面时,以及当我尝试打印它时(在我制作pdf之前)它可以正常工作。
我的CSS的例子:
//if i want to make a static page-break between two elements page-break{ page-break-after:always; clear:both; display:block; } //Avoid cutting images img{ display:block; page-break-before:auto; page-break-after:auto; page-break-inside:avoid; } //avoid cutting text p,em,li,span,tr{ page-break-inside:avoid; }
只有分页符号:总是; 工作,但它插入一堆白色空间。 有没有人对此有任何想法?
I use
WKHTMLTOPDF
to generate a PDF from a printer-friendly webpage. I upgraded from version 0.10.0 rc2 to 0.12.1(with patched qt) but now when I use theCSS
properties likepage-break-before:always;
it inserts a bunch of whitespace, and thepage-breake-inside:avoid;
doesn't work, it's magic.I use this call:
/usr/local/bin/wkhtmltopdf --encoding 'UTF-8' 'page-to-print' '/tmp/PDFV59OZt'
I have tried with and without both
--print-media-type
and--no-print-media-type
.When I render the printer-friendly page in my browser, and when I try to print it (before I make it a pdf) it works fine.
examples of my CSS:
//if i want to make a static page-break between two elements page-break{ page-break-after:always; clear:both; display:block; } //Avoid cutting images img{ display:block; page-break-before:auto; page-break-after:auto; page-break-inside:avoid; } //avoid cutting text p,em,li,span,tr{ page-break-inside:avoid; }
Only page-break-after:always; works, but it inserts a bunch of white-space. Does anyone have any ideas for this?
原文:https://stackoverflow.com/questions/27058472
最满意答案
0x8badf00d
是应用程序花费太长时间启动或终止时,看门狗引发的错误代码。 请参阅苹果的iPhone OS应用程序崩溃报告文档
0x8badf00d
is the error code that the watchdog raises when an application takes too long to launch or terminate. See Apple's Crash Reporting for iPhone OS Applications document
相关问答
更多-
用于学校教学的电脑网络教室,它的网络类型属于() A.互联网 B.广域网 C.城域网 D.局域网[2023-01-12]
d -
这个是unicode编码,是使用:$JAVA_HOME\bin\native2ascii 转换出来的,想要转化回去的话我建议你使用nodepad++,或者eclipse等工具,可以把他们转回中文
-
t00r权限是什么意思[2022-05-18]
root权限跟administrator权限可以理解成一个概念 root是Lnix系统中的超级管理员用户帐户,该帐户拥有整个系统至高无上的权利,所有对象他都可以操作,所以很多黑客在入侵系统的时候,都要把权限提升到root权限,也就是将自己的非法帐户添加到root用户组. root权限跟administrator权限可以理解成一个概念 root是Lnix系统中的超级管理员用户帐户,该帐户拥有整个系统至高无上的权利,所有对象他都可以操作,窢範促既讵焕存唯担沥所以很多黑客在入侵系统的时候,都要把权限提升到root ... -
8badf00d是什么意思?(What does 8badf00d mean?)[2023-11-05]
0x8badf00d是应用程序花费太长时间启动或终止时,看门狗引发的错误代码。 请参阅苹果的iPhone OS应用程序崩溃报告文档 0x8badf00d is the error code that the watchdog raises when an application takes too long to launch or terminate. See Apple's Crash Reporting for iPhone OS Applications document -
iOS11看门狗超时崩溃(0x8badf00d),但代码不在堆栈上(iOS11 watchdog timeout crashes (0x8badf00d) but code not on stack)[2022-06-11]
您的线程0看起来很像我们在iOS 11中遇到的崩溃。这是我们的: Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001853c4bc4 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x00000001853c4a3c mach_msg + 72 2 CoreFou ... -
我不熟悉您正在使用的此API,但您必须发送以下APDU命令序列: 选择PSE(用于联系卡),由第1册,11.3中的EMV指定。 一个例子是“00A404000E315041592E5359532E444446303100” 返回SFI后,您可以读取记录以找出支持的AID。 但是,您可以使用您指定的预定义AID通过“反复试验”执行此操作,并按照第1册,第12.3.3节的指导调用SELECT AID。 您可以调用命令“获取处理选项”来查看可读取的记录,也可以读取所有可能的记录,调用“READ RECORD”命令 ...
-
以下怎么样? 0[xX][0-9a-fA-F]+ 匹配从0开始的表达式,后面是一个较低或大写的x,后跟一个或多个范围为0-9或af或AF的字符 How about the following? 0[xX][0-9a-fA-F]+ Matches expression starting with a 0, following by either a lower or uppercase x, followed by one or more characters in the ranges 0-9, or ...
-
iOS应用仅在某些随机设备上提升0x8badf00d [重复](iOS app raising 0x8badf00d only on some random devices [duplicate])[2024-04-08]
差异的可能原因可能是您正在使用的数据量。 正如您已经说过的,您应该优化您的启动。 你正在加载电话号码,对吗? 如果这可能需要一些时间,请尝试启动并显示带有活动指示符或类似功能的PhoneViewController ,然后启动一个线程以异步加载数据并在完成后更新视图。 A possible reason for differences could be the amount of data you're working with. As you already stated, you should prob ... -
为什么在WP7模拟器中没有捕获到C#.NET WebException?(Why is C# .NET WebException not being caught in WP7 emulator?)[2023-08-15]
研究告诉我Silverlight 3及更高版本中有一个新的ClientHttp堆栈。 http://msdn.microsoft.com/en-us/library/dd920295(v=vs.95).aspx Research tells me there's a new ClientHttp stack in Silverlight 3 and above. http://msdn.microsoft.com/en-us/library/dd920295(v=vs.95).aspx