FOP 1.1不正确的边界

时间:2015-05-26 15:13:35

标签: xslt xsl-fo apache-fop

目前我正在使用xslt在PDF生成中使用fop 1.1。

我给出了1pt纯黑色的边框值。所以我周围都会有厚厚的边框。但实际上并非如此。请告诉我解决方案。

<fo:table table-layout="fixed" width="100%">

                        <fo:table-column column-number="1" column-width="10%" />
                        <fo:table-column column-number="2" column-width="40%" />
                        <fo:table-column column-number="3" column-width="10%" />
                        <fo:table-column column-number="4" column-width="20%" />
                        <fo:table-column column-number="5" column-width="20%" />

                        <!-- Table Header -->
                        <fo:table-header>
                            <fo:table-row>
                                <fo:table-cell column-number="1" border-top="solid 1pt black"
                                    border-left="solid 1pt black" border-bottom="solid 1pt black">
                                    <fo:block line-height="7pt" orphans="2" margin-top="3pt"
                                        margin-bottom="3pt" font-size="6pt" text-align="center"
                                        widows="2">
                                        Item
                                    </fo:block>
                                </fo:table-cell>

                                <fo:table-cell column-number="2" border-top="solid 1pt black"
                                    border-left="solid 1pt black" border-bottom="solid 1pt black">
                                    <fo:block line-height="7pt" orphans="2" margin-top="3pt"
                                        margin-bottom="3pt" font-size="6pt" text-align="center"
                                        widows="2">Commodity
                                        &amp;
                                        Description
                                    </fo:block>
                                </fo:table-cell>

                                <fo:table-cell column-number="3" border-top="solid 1pt black"
                                    border-left="solid 1pt black" border-bottom="solid 1pt black">
                                    <fo:block line-height="7pt" orphans="2" margin-top="3pt"
                                        margin-bottom="3pt" font-size="6pt" text-align="center"
                                        widows="2">
                                        Quantity
                                    </fo:block>
                                </fo:table-cell>

                                <fo:table-cell column-number="4" border-top="solid 1pt black"
                                    border-left="solid 1pt black" border-bottom="solid 1pt black">
                                    <fo:block line-height="7pt" orphans="2" margin-top="3pt"
                                        margin-bottom="3pt" font-size="6pt" text-align="center"
                                        widows="2">
                                        Unit Price
                                    </fo:block>
                                </fo:table-cell>

                                <fo:table-cell column-number="5" border-top="solid 1pt black"
                                    border-left="solid 1pt black" border-right="solid 1pt black"
                                    border-bottom="solid 1pt black">
                                    <fo:block line-height="7pt" orphans="2" margin-top="3pt"
                                        margin-bottom="3pt" font-size="6pt" text-align="center"
                                        widows="2">
                                        Amount
                                    </fo:block>
                                </fo:table-cell>
                            </fo:table-row>

                        </fo:table-header>

                        <fo:table-body>

                        <fo:table-row>
                                    <fo:table-cell column-number="1" border-left="solid 1pt black" height="1pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell column-number="2" border-left="solid 1pt black" height="1pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="3pt"
                                            font-family="Courier New" font-size="8pt" text-align="start"
                                            widows="2">
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell column-number="3" border-left="solid 1pt black" height="1pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                        </fo:block>
                                    </fo:table-cell>

                                    <fo:table-cell column-number="4" border-left="solid 1pt black" height="1pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="left"
                                            widows="2">
                                        </fo:block>
                                    </fo:table-cell>

                                    <fo:table-cell column-number="5" border-right="solid 1pt black" height="1pt"
                                        border-left="solid 1pt black">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            <xsl:for-each select="unitDetail">


                                <fo:table-row>
                                    <fo:table-cell column-number="1" height="8pt"
                                        border-left="solid 1pt black">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                            <xsl:value-of select="item" />
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell column-number="2" border-left="solid 1pt black"
                                        height="8pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="3pt"
                                            font-family="Courier New" font-size="8pt" text-align="start"
                                            widows="2">
                                            <xsl:value-of select="description" />
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell column-number="3" border-left="solid 1pt black"
                                        height="8pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                            <xsl:value-of select="quantity" />
                                        </fo:block>
                                    </fo:table-cell>

                                    <fo:table-cell column-number="4" border-left="solid 1pt black"
                                        height="8pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="left"
                                            widows="2">
                                            <xsl:value-of select="unitPrice" />
                                        </fo:block>
                                    </fo:table-cell>

                                    <fo:table-cell column-number="5" border-right="solid 1pt black"
                                        border-left="solid 1pt black" height="8pt">
                                        <fo:block line-height="8pt" orphans="2" margin-left="10pt"
                                            font-family="Courier New" font-size="8pt" text-align="center"
                                            widows="2">
                                            <xsl:value-of select="amount" />
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </xsl:for-each>
                        </fo:table-body>
                    </fo:table>

Image 具有不同边框厚度的表甚至边框值实心1pt黑色

1 个答案:

答案 0 :(得分:1)

输出更改是由于Adobe Reader属性,而不是因为FOP或其他XSLT功能。为了获得原始边界,我已经遵循了以下步骤。

  1. 单击“编辑”菜单,单击“首选项”。
  2. 单击列表中的“页面显示”。
  3. 单击“平滑文本”列表,然后单击“
  4. 取消选中“平滑线条图案和平滑图像框”