xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO to PDF conversion speed

2013-10-01 06:45:26
On Tue, October 1, 2013 10:07 am, Jesper Tverskov wrote:
...
2)
The FO contained the following cracy SVG, used four times to create
small HTML like form checkboxes!

<fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg";>
<svg:svg width="9pt" height="9pt">
<svg:g style="fill:none; stroke:black; stroke-width:1">
<svg:rect x="0" y="0" width="9" height="9"/>
</svg:g>
</svg:svg>
</fo:instream-foreign-object>

I managed to replace the SVG with the following:

<fo:inline font-size="8pt">
<fo:leader leader-pattern="rule" rule-thickness="8pt" color="white"
border="solid 1pt black" leader-length="9pt"
alignment-baseline="mathematical"/>
</fo:inline>

I don't know what "mathematical" means but it gave me the most perfect
vertical alignment of the checkboxes.

When aligning characters on baselines, 'mathematical' identifies the
baseline used by mathematical symbols [1].  You've aligned the center of
the white rule on the 'mathematical' baseline of the parent area [2][3]. 
You could have used the 'baseline-shift' property to shift the rule up or
down rather than chancing upon a baseline that matched what you want.

You could perhaps have used a checkbox-like character from, e.g., Zapf
Dingbats or WingDings (assuming the fonts are available to you) instead of
making a checkbox with fo:leader.

Sadly enough there where no really bad FO in the original solution
like nested tables.

Do you have other, more necessary SVG graphics?  My expectation is that
you saved more of the 20% by replacing the SVGs than you did by replacing
the table.

Regards,


Tony Graham                                   tgraham(_at_)mentea(_dot_)net
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL-FO and XSLT consulting, training and programming
       Chair, Print and Page Layout Community Group @ W3C

[1] http://www.w3.org/TR/xsl11/#area-alignment
[2] http://www.w3.org/TR/xsl11/#rule-thickness
[3] http://www.w3.org/TR/xsl11/#alignment-baseline


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--