Open marryton007 opened 5 years ago
CSS样式里面有什么设置是可以设置一个元素不能跨页的吗?
看了这个连接, 里面有这一段描述,
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
但这个不知道加在vnote的哪个地方?
配置文件夹,v_pure.css
加在哪个元素下? pre? code? 还是pre code?
pre试试
测试了以下方式,都不行。
pre {
display: block;
overflow-y: hidden;
overflow-x: auto;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
code { font-family: Consolas, Monaco, Monospace, Courier; color: #8E24AA; word-break: break-all; page-break-before: always; page-break-after: always; page-break-inside: avoid; }
* common.css
```css
@media print {
pre, pre code, td.hljs-ln-code {
white-space: pre-wrap !important;
word-break: break-all !important;
page-break-inside: avoid !important;
}
code, a {
word-break: break-all !important;
page-break-inside: avoid !important;
}
另外,不使用wkhtmltopdf导出的PDF是正常的,还有使用打印功能打出的PDF文件也是正常的。
现在的问题是只有wkhtmltopdf导出有问题。
OS Version (操作系统): Windows, Linux, macOS windows VNote Version (Help - About VNote - Version: )(VNote版本): 2.2, d78e892d5cc etc.. 2.7.2 Symptoms (表现):
输出日志:
PDF效果图:
How to Repro (如何复现): 使用wkhtmltopdf方式导出pdf格式,如最上图所示