XSL FO - 尊重填充

发布于 2024-10-31 23:47:33 字数 2850 浏览 3 评论 0原文

除了第 1 页之外,我的桌子上的所有内容都没有像我告诉的那样填充。我确实有一个 "first" 和一个 "Rest" 定义为

<!-- layout for the first page -->
        <fo:simple-page-master master-name="first"
              page-height="11in"
              page-width="8.5in"
              margin-top="1cm"
              margin-bottom="2cm"
              margin-left="2.5cm"
              margin-right="2.5cm">
          <fo:region-body margin-top="3cm"/>
          <fo:region-before extent="2cm"/>
          <fo:region-after extent=".1cm"/>
        </fo:simple-page-master>

        <!-- layout for the other pages -->
        <fo:simple-page-master master-name="rest"
                      page-height="11in"
                      page-width="8.5in"
                      margin-top="1cm"
                      margin-bottom="2cm"
                      margin-left="2.5cm"
                      margin-right="2.5cm">
          <fo:region-body margin-top="3cm"/>
          <fo:region-before extent="2cm"/>
          <fo:region-after extent=".1cm"/>
        </fo:simple-page-master>

但是,我不知道这会如何影响我的填充。

<fo:block>
            <!-- table start -->
            <fo:table table-layout="fixed" width="100%" border-collapse="separate" padding-after="1em">
              <fo:table-column column-width="15mm"/>
              <fo:table-column column-width="46mm"/>
              <fo:table-column column-width="28mm"/>
              <fo:table-column column-width="22mm"/>
              <fo:table-column column-width="19mm"/>
              <fo:table-column column-width="30mm"/>

              <fo:table-header>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" >
                    <fo:inline padding-left="1mm">Model</fo:inline>
                  </fo:block>
                </fo:table-cell>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" border-left="none">
                    <fo:inline padding-left="2mm">Description</fo:inline>
                  </fo:block>
                </fo:table-cell>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" padding-left=".1mm" border-left="none">
                    <fo:inline padding-left="2mm">Material</fo:inline>
                  </fo:block>
                </fo:table-cell>

请注意 padding-left 属性。为什么它在除第一页之外的所有页面上都没有得到尊重?

更新
我注意到这只发生在“溢出页面”上。当我的表有足够的数据可以换行到另一页时。如果是新表,问题就会消失。

On all except page-1 my table does not pad like I tell it to. I do have a "first" and a "Rest" defined as

<!-- layout for the first page -->
        <fo:simple-page-master master-name="first"
              page-height="11in"
              page-width="8.5in"
              margin-top="1cm"
              margin-bottom="2cm"
              margin-left="2.5cm"
              margin-right="2.5cm">
          <fo:region-body margin-top="3cm"/>
          <fo:region-before extent="2cm"/>
          <fo:region-after extent=".1cm"/>
        </fo:simple-page-master>

        <!-- layout for the other pages -->
        <fo:simple-page-master master-name="rest"
                      page-height="11in"
                      page-width="8.5in"
                      margin-top="1cm"
                      margin-bottom="2cm"
                      margin-left="2.5cm"
                      margin-right="2.5cm">
          <fo:region-body margin-top="3cm"/>
          <fo:region-before extent="2cm"/>
          <fo:region-after extent=".1cm"/>
        </fo:simple-page-master>

But, I don't see how this would affect my padding.

<fo:block>
            <!-- table start -->
            <fo:table table-layout="fixed" width="100%" border-collapse="separate" padding-after="1em">
              <fo:table-column column-width="15mm"/>
              <fo:table-column column-width="46mm"/>
              <fo:table-column column-width="28mm"/>
              <fo:table-column column-width="22mm"/>
              <fo:table-column column-width="19mm"/>
              <fo:table-column column-width="30mm"/>

              <fo:table-header>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" >
                    <fo:inline padding-left="1mm">Model</fo:inline>
                  </fo:block>
                </fo:table-cell>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" border-left="none">
                    <fo:inline padding-left="2mm">Description</fo:inline>
                  </fo:block>
                </fo:table-cell>
                <fo:table-cell>
                  <fo:block font-weight="bold" border-width="0.5mm" border-style="solid" padding-left=".1mm" border-left="none">
                    <fo:inline padding-left="2mm">Material</fo:inline>
                  </fo:block>
                </fo:table-cell>

Note the padding-left attribute. Why doesn't it get respected on all but the first page?

UPDATE
I noticed this only happens on "overflow pages". When my table has enough data to wrap to another page. If its a new table, the problem goes away.

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

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

发布评论

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

评论(1

爱给你人给你 2024-11-07 23:47:33

这可能是 XSL FO 处理器实现 APACHE FOP 的限制。我会联系他们。

This is probably a limitation of the XSL FO processor implementation, APACHE FOP. I will contact them.

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