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

Subject: Re: [xsl] XSL-FO to PDF conversion speed
From: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Tue, 1 Oct 2013 12:45:11 +0100 (IST)
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@xxxxxxxxxx
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

Current Thread