<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>All:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This is possible to accomplish without &#8220;two passes&#8221;
but does require special processing of the intermediate format file (<a
href="http://www.renderx.com/reference.html#IntermediateFormatSpecification_Specification">http://www.renderx.com/reference.html#IntermediateFormatSpecification_Specification</a>
). This is similar in nature to the Transpromo application we created &nbsp;for
a customer. Take a look at this white paper from the RenderX web site (<a
href="http://www.renderx.com/solutions/wp_transpromo.html">http://www.renderx.com/solutions/wp_transpromo.html</a>).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The problem here is to inject a variable size image into a
document. Think of your monthly statement from a bank. The last page frequently
has available white space below the last line items and summary. The image to
inject is based some parameters from your account (like balance) and of course on
available white space. The solution lies in the fact that RenderX supports a
hidden extension element &lt;rx:pinpoint&gt;. This element has a &#8220;value&#8221;
attribute and when dropped in the FO source, it will be placed in the RenderX
Intermediate Format (xml) file. The Intermediate File can be obtained from
RenderX software for any application using the API or even command line. You
can then process this intermediate file to &#8220;find&#8221; pinpoints. In the
intermediate format, pinpoints carry the &#8220;value&#8221; attribute as a
marker for you as well as attributes about its position on the page (x, y
location) like this:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN style='font-size:10.0pt;font-family:"Courier New";
color:black'>&lt;xep:pinpoint x=&quot;56693&quot; y=&quot;262888&quot;
value=&quot;promo,96;promo1.jpg&quot;/&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>So, in your application, one could measure the height of this
table cell using two &lt;rx:pinpoints&gt; and then using a little XSLT math
find out the height. Better, if you fill the table cell in question with a
specific color, then you could search the intermediate file and find and extract
the dimensions of the &lt;xep:rectangle&gt; that is that color and you will
know the exact size of the space. This would be like this but preceded by your
color:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<pre><span lang=EN>&lt;xep:gray-color gray=&quot;1.0&quot;/&gt;<o:p></o:p></span></pre><pre><span
lang=EN>&lt;xep:rectangle x-from=&quot;56693&quot; y-from=&quot;56693&quot; x-till=&quot;526693&quot; y-till=&quot;262888&quot;/&gt;<o:p></o:p></span></pre>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Then, without even reprocessing anything, you could modify the
intermediate format to add the SVG with the proper height and then send the
intermediate file to the RenderX backend. You would only need to convert XEP
units to your units but this is easy as XEP units are 0.001pt.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>All of this could be done programmatically without human
intervention and the RenderX team uses such techniques all the time in custom
situations for inserting OMR marks, special barcoding, concatenation of huge
mail packages, custom layouts that span columns, etc.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>In addition, there is another white paper that uses this same technique
to measure areas for PDF form fields and dynamically creates a fillable form by
calling iText software with the intermediate file &#8220;measurements&#8221; to
stamp the form fields. This paper is posted here: <a
href="http://www.renderx.com/solutions/wp_itext_forms.html">http://www.renderx.com/solutions/wp_itext_forms.html</a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Kevin Brown<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Executive Vice President, Sales &amp; Marketing<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>RenderX, Inc.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>(650) 328-8000 Main<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>(650) 327-1000 Direct<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>(650) 328-8008 Fax<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'>(925) 395-1772 Mobile<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a href="skype:kbrown01?call"><span style='color:blue'>skype:kbrown01</span></a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a href="mailto:kevin@renderx.com"><span style='color:blue'>kevin@renderx.com</span></a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a href="mailto:sales@renderx.com"><span style='color:blue'>sales@renderx.com</span></a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com] <b>On
Behalf Of </b>Mark Cilia Vincenti<br>
<b>Sent:</b> Wednesday, December 10, 2008 7:08 AM<br>
<b>To:</b> xep-support@renderx.com<br>
<b>Subject:</b> Re: [xep-support] Re: Image scaling<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>Hmm...<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>A RenderX extension that takes a line of text, a font
family, a font-size, width of a block in pixels and outputs the number of lines
this would fit on would be nice :)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;xsl:variable
name=&quot;numlines&quot;&gt;&lt;rx:number-of-lines font-family=&quot;MyriadPro&quot;
font-size=&quot;12pt&quot; width=&quot;210mm&quot; text=&quot;This is a long
line and I wonder how many lines it will end up wrapping on. Perhaps two or
three, who knows?&quot; /&gt;&lt;/xsl:variable&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;xsl:choose&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;xsl:when test=&quot;$numlines =
1&quot;&gt;.........&lt;/xsl:when&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;xsl:when test=&quot;$numlines =
2&quot;&gt;.........&lt;/xsl:when&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;xsl:otherwise&gt;........&lt;/xsl:otherwise&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&lt;/xsl:choose&gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>... or even better
&lt;rx:number-of-lines&gt; would allow nested blocks inside it for when you
have words that are bolded and others which aren't.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>2008/12/10 Jim Mott &lt;<a href="mailto:jmott@pubdata.com">jmott@pubdata.com</a>&gt;<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Mark,</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I
don't have any special insight on this, but I was thinking before&nbsp;when I
read your first posting that the engine would not be able to know the height on
just one pass precisely&nbsp;because of the variable height of the text. It
seems to me&nbsp;you have to get feedback from the engine as an intermediary
stage&nbsp;and provide the height on a second pass.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#888888'>Jim Mott</span><span style='color:#888888'><o:p></o:p></span></p>

</div>

<div>

<div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>----- Original Message ----- <o:p></o:p></p>

</div>

<blockquote style='border:none;border-left:solid black 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<div>

<p class=MsoNormal style='background:#E4E4E4'><b><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Arial","sans-serif"'> <a href="mailto:markciliavincenti@gmail.com"
target="_blank" title="markciliavincenti@gmail.com">Mark Cilia Vincenti</a> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>To:</span></b><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <a
href="mailto:xep-support@renderx.com" target="_blank"
title="xep-support@renderx.com">xep-support@renderx.com</a> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Sent:</span></b><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'> December 10, 2008
3:33 AM<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Subject:</span></b><span
style='font-size:10.0pt;font-family:"Arial","sans-serif"'> Re: [xep-support]
Re: Image scaling<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Hi Alexei,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Thanks for your email.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Unfortunately it's the height I
don't know, because if the text in the box wraps, then it would increase the
height. I tried cheating using reference-orientation but it did not work.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>2008/12/10 Alexei Gagarinov &lt;<a
href="mailto:agagarinov@renderx.com" target="_blank">agagarinov@renderx.com</a>&gt;<o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Hi Mark,<o:p></o:p></p>

<div>

<p class=MsoNormal>&lt;fo:block line-height=&quot;0pt&quot;&gt;<br>
&nbsp;&lt;fo:external-graphic<br>
&nbsp; &nbsp; &nbsp; &nbsp;content-width=&quot;scale-to-fit&quot;
content-height=&quot;scale-to-fit&quot;<br>
&nbsp; &nbsp; &nbsp; &nbsp;scaling=&quot;non-uniform&quot;
scaling-method=&quot;resample-any-method&quot;&gt;<o:p></o:p></p>

</div>

<p class=MsoNormal>...<o:p></o:p></p>

<p class=MsoNormal><br>
You should set the viewport's area using @width and @height attributes on the
fo:external-graphic element.<br>
<br>
If @width and @height are omitted then they are treated as 'auto' and it means
that viewport's area equals to the intrinsic size of the graphic.<br>
<br>
And what you do is scaling the intrinsic size of the image to the ... yeah, to
the same value.<br>
<br>
So, in order to scale the graphics width to a table cell, you need the following:<br>
&lt;fo:external-graphic width=&quot;100%&quot;
content-width=&quot;scale-to-fit&quot; src=&quot;...&quot;&gt;<br>
<br>
But you cannot scale the image's height to an arbitrary block (a table cell in
your example) using a percentage value because the height of this block depends
of its content.<br>
So you should know the height of the surrounding box ahead and specify this
length as a value of @height on fo:external-graphic.<br>
<br>
Regards,<br>
&nbsp;Alexey Gagarinov<br>
RenderX <o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
<br>
-------------------<br>
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'<br>
in the body of the message to <a href="mailto:majordomo@renderx.com"
target="_blank">majordomo@renderx.com</a> from the address<br>
you are subscribed from.<br>
(*) By using the Service, you expressly agree to these Terms of Service <a
href="http://www.renderx.com/terms-of-service.html" target="_blank">http://www.renderx.com/terms-of-service.html</a><o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</blockquote>

</div>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>