I'm working on a program to convert XML documents into LaTeX. The XML has several possibly ways of specifying how an image should be placed, and I'm trying to find ways to produce LaTeX that will place the image correctly, without having to actually open the image file in the XML->LaTeX converter.<div>
<br></div><div>For example, when the XML specifies size and position of the image, </div><div><br></div><div><div><fo:block></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><fo:external-graphic src="url(xyz/image_1129.eps)"</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>content-height="2in"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>content-width="3.5in"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>myns:transformation="1 0 0 1 -8.71591 -17.5625"/></div>
<div></fo:block></div></div><div><br></div><div>I can say generate LaTeX that looks like:</div><div><br></div><div><div>\begin{picture}(0,0)</div><div>\put(-8.715910,-113.978116){\includegraphics{xyz/image_1129.pdf}}</div>
<div>\end{picture</div></div><div><br></div><div>I was able to find the upper left corner of the image because I know where the transformation puts the lower left corner, and I know the height of the image.</div><div><br>
</div><div>However, sometimes the XML only specifies a transformation (and again, the translation components refer to the *lower* left corner of the image):</div><div><br></div><div><div><fo:block></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><fo:external-graphic src="url(Documents/1/Resources/AP_logo_wirm_PMS_LLP.eps)"</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>content-height="33.1209%"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>content-width="33.1209%"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>myns:transformation="0.331209 0 0 0.331209 0 -11.7663"/></div>
<div></fo:block></div></div><div><br></div><div>The content-height and content-width attributes just give me scale factors from the transform matrix.</div><div><br></div><div>Is there a way to determine how to place the image in LaTeX given this? I don't care about the dimensions per se, but I might need to know the height to determine the upper left corner, given the lower left corner.</div>
<div><br></div><div>Is there a way around this? I think this describes the problem, but I can try to be more explicit if this is not clear.</div><div><br></div><div>Thank you!</div><div><br></div><div>-pd</div><div><br></div>
<div><br></div><div><br clear="all"><br>-- <br><span style="font-family:arial, sans-serif;border-collapse:collapse">----<div>The Tech Curmudgeon</div><div><a href="http://www.techcurmudgeon.com/" style="color:rgb(17, 65, 112)" target="_blank">http://www.techcurmudgeon.com</a></div>
<div style="font-size:10.8333px"><br></div></span><br>
</div>