[xep-support] XEP intermediate output - xep:target coordinates

From: Jan To¹ovskı <j.tosovsky@gmc.net>
Date: Mon Dec 17 2012 - 03:10:19 PST

Dear All,
during investigating XEP intermediate format I encountered (XEP 4.20), that xep:target element's 'y' coordinate doesn't correspond to the absolute page coordinates. It looks it uses different resolution and coordinate origin (somehow related to the top margin).
I use the following equation to fix it:
<xsl:variable name="targetNode" select="$xepFileContent//xep:target[@id = $id]"/>
<xsl:if test="$targetNode">
         <xsl:variable name="pageHeight" select="841890"/>
         <xsl:variable name="pageMarginTop" select="85039"/>
         <xsl:variable name="flowTop" select="$pageHeight - $pageMarginTop"/>
         <xsl:variable name="ratio" select="$pageHeight div ($pageHeight - $pageMarginTop)"/>
         <xsl:variable name="y0" select="$targetNode/@y"/>
         <xsl:variable name="y1" select="$ratio * ($flowTop - $y0)"/>
         <xsl:variable name="y2" select="$flowTop - $y1"/>
         <xsl:value-of select="$y2"/>
</xsl:if>
I don't know if it is correct, but in my case the $y2 variable looks much better now. Unfortunately, I have to pass at least that pageMarginTop parameter which I'd like to avoid (pageHeight can be obtained directly from the Xep file).
Is this behaviour a bug or feature?
Thanks,
Jan

!DSPAM:87,50ceff0863735808610245!

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Mon Dec 17 03:03:24 2012

This archive was generated by hypermail 2.1.8 : Mon Dec 17 2012 - 03:03:29 PST