问题描述
我正在使用PrinceXml
将html
文件转换为pdf
,但似乎忽略了文件头中声明的字体大小。这是头部的相关部分
<!doctype html><html><head><Meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><style type="text/css">
html{font-family:Tahoma}
p{margin:0px}
.section{color:black;font-weight:bold;font-size:40px;
text-align:end;padding:500px 0px 0px 0px;page-break-before: right;
page-break-after:always;string-set: chapter content()}
.subsection{margin:15px 0px 5px 0px;font-weight:bold;font-size:30px;border-style: solid; border-width: 0px 0px 1px 0px;color:gray;string-set: subsection content()}
.oddclass{margin:3px 0px 0px 0px; font-size:9pt;color:red}
}</style>
最后一行“ oddclass”不影响font-size
。虽然颜色确实会改变。在Chrome浏览器中,所有功能都很完美。我不知道这里发生了什么。
如果我使用内联样式,则可以,但是不能通过类。我在做什么错了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)