简体   繁体   English

浏览器中xsl-fo中的字体大小不同?

[英]Font size in xsl-fo difference in browser?

I'm using apache FOP to generate pdf documents with common parameters:我正在使用 apache FOP 生成具有常用参数的 pdf 文档:

  • font-size: 10px字体大小:10px
  • font-family: Arial字体系列:Arial

The content pdf like as image below:内容 pdf 如下图所示: 在此处输入图像描述 pdf content pdf 内容

Besides, I also build similar content using HTML tag ( <table>, <tr>, <td>, <div>,... ).此外,我还使用 HTML 标签( <table>, <tr>, <td>, <div>,... )构建了类似的内容。 However, on HTML page the characters are smaller than PDF page, even though I used the same font-size and font-family in both.但是,在HTML页面上,字符小于PDF页面,即使我在两者中使用了相同的font-sizefont-family What the difference with pixel between xsl-fo and html ? xsl-fohtml之间的像素有什么区别? 在此处输入图像描述 Html content Html 内容

Lengths in px can be unreliable because different software can have different ideas about the absolute size of a pixel.px为单位的长度可能不可靠,因为不同的软件可能对像素的绝对大小有不同的想法。

In XSL-FO, px is implementation-dependent, but the Recommendation does recommend 1/92" or 1/72".在 XSL-FO 中, px是依赖于实现的,但建议书确实推荐 1/92" 或 1/72"。 See https://www.w3.org/TR/xsl11/#pixelshttps://www.w3.org/TR/xsl11/#pixels

I haven't been able to find the size of a FOP pixel.我无法找到 FOP 像素的大小。 (FWIW, AH Formatter defaults to 96 px per inch, but you can change it. See https://www.antenna.co.jp/AHF/help/en/ahf-optset.html#pxpi ) (FWIW,AH Formatter 默认为每英寸 96 px ,但您可以更改它。请参阅https://www.antenna.co.jp/AHF/help/en/ahf-optset.html#pxpi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM