简体   繁体   中英

Font size in xsl-fo difference in browser?

I'm using apache FOP to generate pdf documents with common parameters:

  • font-size: 10px
  • font-family: Arial

The content pdf like as image below: 在此处输入图像描述 pdf content

Besides, I also build similar content using HTML tag ( <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. What the difference with pixel between xsl-fo and html ? 在此处输入图像描述 Html content

Lengths in px can be unreliable because different software can have different ideas about the absolute size of a pixel.

In XSL-FO, px is implementation-dependent, but the Recommendation does recommend 1/92" or 1/72". See https://www.w3.org/TR/xsl11/#pixels

I haven't been able to find the size of a FOP pixel. (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 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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