XSL FO 中的页面保护属性

问题描述

我需要像附加图像一样实现 XSL-FOP 布局。

一个父表“请求的项目信息”。里面有一个子表“项目名称”,里面有另一个子表“技术信息”,其中将有多个记录。

现在,当分页符时,所有父表标题都应与大子表名称一起显示

附加图片第二页以“请求物品信息”开头,然后是“物品名称”,然后是“技术信息”。

这是在 RDF 中实现的“页面保护”属性。现在我需要在 XSL-FOP 中实现它。

我尝试了 page-break-inside="avoid" 属性,但是一旦页面填满,所有数据只会出现在一页中,然后其余数据不可见,这意味着数据根本不存在进入第二页。

我尝试了 keep-together="always" 属性,但表格内容没有换行。数据超过 pdf 宽度大小。但是,下一页没有按需要出现。

预先感谢您的建议和建议

Need to implement PDF like this image

下面是代码

<fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-weight="normal" font-style="normal" color="#000000" text-align="left" >
       <fo:table border-style="solid" border-width="0.0mm">
          <fo:table-column column-width="200mm" border-style="solid" border-width="0.1mm" />          
          <fo:table-body>
             <fo:table-row height="0.2cm">
                <fo:table-cell number-columns-spanned="1">
                   <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                      Requested Items information
                   </fo:block>
                </fo:table-cell>
            </fo:table-row>
            <fo:table-row height="0.2cm">
                <fo:table-cell number-columns-spanned="1">
                    <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                            
                       <fo:table border-style="solid" border-width="0.0mm">
                          <fo:table-column column-width="200mm" border-style="solid" border-width="0.1mm" />          
                          <fo:table-body>
                             <fo:table-row height="0.2cm" border-bottom-style="solid" border-width="0.1mm">
                                <fo:table-cell number-columns-spanned="1">
                                   <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                                      Item Name: 
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.2cm">
                                <fo:table-cell number-columns-spanned="1">
                                   <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                      <fo:table border-style="solid" border-width="0.0mm">
                                      <fo:table-column column-width="42mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="25mm" border-style="solid" border-width="0.0mm" />                                   
                                      <fo:table-column column-width="35mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="30mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="38mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-column column-width="30mm" border-style="solid" border-width="0.0mm" />
                                      <fo:table-body>
                                         <fo:table-row height="0.2cm">
                                            <fo:table-cell number-columns-spanned="1">
                                            <fo:block margin-left="0.0cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                                  <fo:table border-style="solid" border-width="0.0mm">
                                                      <fo:table-column column-width="200mm" border-style="solid" border-width="0.0mm" />
                                                      <fo:table-body>
                                                          <fo:table-row height="0.2cm">
                                                            <fo:table-cell number-columns-spanned="1">
                                                               <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="bold" font-style="normal" color="#000000" text-align="left">
                                                                  Technical information
                                                               </fo:block>                                                             
                                                            </fo:table-cell>                                                                                                                
                                                        </fo:table-row>
                                                         <fo:table-row height="0.2cm">
                                                            <fo:table-cell number-columns-spanned="1">
                                                               <fo:block margin-left="0.2cm" margin-right="0.0cm" margin-top="0.2cm" font-size="10pt" font-weight="normal" font-style="normal" color="#000000" text-align="left">
                                                                 description
                                                               </fo:block>                                                             
                                                            </fo:table-cell>                                                                                                                        
                                                        </fo:table-row>
                                                    </fo:table-body>
                                                </fo:table>
                                                </fo:block>
                                            </fo:table-cell>
                                        </fo:table-row>
                                      </fo:table-body>
                                      </fo:table>                                  
                                   </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                      </fo:table>   
                    </fo:block>
                </fo:table-cell>                
             </fo:table-row>
          </fo:table-body>
       </fo:table>
</fo:block>

fo:table-header 正在解决这个问题。谢谢托尼。

但是,当分页显示为损坏时,我遇到了问题。

enter image description here

有没有办法在分页关闭表格?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...