更改 Apache FOP 中的表结尾缩进

发布于 2024-11-16 21:35:49 字数 2073 浏览 3 评论 0原文

我正在使用 Apache FOP 1.0 生成 PDF。我想扩展表的结尾缩进,这样我就不会收到 INFO 警告:

信息:fo:table 比 inline-progression-dimension 中的可用空间更宽。根据过度约束的几何规则调整末端缩进(XSL 1.1,第 5.3.4 章)。

这是一张超出表格宽度的表格:

<?xml version="1.0" encoding="UTF-8"?>
   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
      <fo:simple-page-master 
         master-name="CommonMasterLayout"
         page-height="11in" page-width="8.5in" 
         margin-top=".5in" margin-bottom=".5in" 
         margin-left="1in" margin-right="1in">
         <fo:region-body region-name="middle" margin-bottom=".75in" margin-top=".75in"/>
         <fo:region-before region-name="top" extent=".75in"/>
         <fo:region-after region-name="bottom" extent=".5in"/>
       </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-reference="CommonMasterLayout">
       <fo:flow flow-name="middle">
         <fo:block>
           <fo:table end-indent="-0.5in" width="100%" table-layout="fixed">
             <fo:table-column column-width="2.033in"/>
             <fo:table-column column-width="4.616in"/>
             <fo:table-body>
               <fo:table-row>
                 <fo:table-cell border="0.5pt solid black">
                  <fo:block>Some text that will flow over to the neighboring cell</fo:block>
                 </fo:table-cell>
                 <fo:table-cell border="0.5pt solid black">
                   <fo:block>Other text within a box</fo:block>
                 </fo:table-cell>
               </fo:table-row>
             </fo:table-body>
           </fo:table>
         </fo:block>
       </fo:flow>
     </fo:page-sequence>
   </fo:root>

页面宽度为 6.5 英寸,表格宽度为 6.649 英寸,明显超出尺寸。我两侧都有 1 英寸的填充,所以我想稍微延长右侧。

使用表格属性 end-indent="-0.5in" 会导致单元格内的文本溢出到相邻单元格中,就像列宽发生变化一样。我为此使用了正确的属性吗?

I am using Apache FOP 1.0 to generate PDF. I want to extend the end-indent of the table such that I do not get the INFO warnings:

INFO: An fo:table is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4).

Here is a table with overflowing table width:

<?xml version="1.0" encoding="UTF-8"?>
   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
      <fo:simple-page-master 
         master-name="CommonMasterLayout"
         page-height="11in" page-width="8.5in" 
         margin-top=".5in" margin-bottom=".5in" 
         margin-left="1in" margin-right="1in">
         <fo:region-body region-name="middle" margin-bottom=".75in" margin-top=".75in"/>
         <fo:region-before region-name="top" extent=".75in"/>
         <fo:region-after region-name="bottom" extent=".5in"/>
       </fo:simple-page-master>
     </fo:layout-master-set>
     <fo:page-sequence master-reference="CommonMasterLayout">
       <fo:flow flow-name="middle">
         <fo:block>
           <fo:table end-indent="-0.5in" width="100%" table-layout="fixed">
             <fo:table-column column-width="2.033in"/>
             <fo:table-column column-width="4.616in"/>
             <fo:table-body>
               <fo:table-row>
                 <fo:table-cell border="0.5pt solid black">
                  <fo:block>Some text that will flow over to the neighboring cell</fo:block>
                 </fo:table-cell>
                 <fo:table-cell border="0.5pt solid black">
                   <fo:block>Other text within a box</fo:block>
                 </fo:table-cell>
               </fo:table-row>
             </fo:table-body>
           </fo:table>
         </fo:block>
       </fo:flow>
     </fo:page-sequence>
   </fo:root>

The page width is 6.5inches and the table is 6.649in wide, clearly exceeding the dimension. I have 1in padding on both sides so I want to extend the right a little.

Using the table attribute end-indent="-0.5in" causes the text within cells to overflow into neighboring cells as if the column width changed. Am I using the correct attribute for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年少掌心 2024-11-23 21:35:49

end-indent="0in" 添加到 fo:table-body

Add end-indent="0in" to fo:table-body.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文