<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Roman,<div><br></div><div>The text monad is very low level and its functions are mapping directly to the PDF text environment commands.</div><div><br></div><div>"text" function is generating two PDF commands : Td and Tj. In Adobe PDF spec :</div><div><br></div><div><div>Td : Move to the start of the <b>next line</b>, offset from the start of the current line by&nbsp;(tx , ty ). tx and ty are numbers expressed in unscaled text space units.</div><div><br></div><div><div>Tj : Show a text string.&nbsp;</div><div><br></div><div>So, the behavior is correct and HPDF really needs a documentation :-) and some cleaning of the API.</div><div><br></div><div>Thanks,</div><div>Christophe.</div></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Here is a program which illustrates an unexpected behaviour:<br><br> &nbsp;import Graphics.PDF<br><br> &nbsp;main = runPdf "bug.pdf" standardDocInfo (PDFRect 0 0 100 100) pdf<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pdf = do<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p &lt;- addPage Nothing<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drawWithPage p $ drawText $<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sequence $ replicate 10 $<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text (PDFFont Helvetica 10) 10 10 (toPDFString "ABC")<br><br>What I expect here is "ABC" printed 10 times on the same place (starting<br>at (10,10)). What I see (in Okular) is ABC printed each time in the new<br>place like this:<br><br> &nbsp;&nbsp;ABC<br> &nbsp;ABC<br> ABC<br>ABC<br><br>What's happening here? I'm using HPDF-1.4.1 from Hackage.<br><br>-- <br>Roman I. Cheplyaka :: <a href="http://ro-che.info/">http://ro-che.info/</a><br>"Don't let school get in the way of your education." - Mark Twain<br></div></blockquote></div><br></div></body></html>