[Haskell-cafe] Re: bug in HPDF?
misc at alpheccar.org
Tue Jan 6 13:37:31 EST 2009
The text monad is very low level and its functions are mapping
directly to the PDF text environment commands.
"text" function is generating two PDF commands : Td and Tj. In Adobe
PDF spec :
Td : Move to the start of the next line, offset from the start of the
current line by (tx , ty ). tx and ty are numbers expressed in
unscaled text space units.
Tj : Show a text string.
So, the behavior is correct and HPDF really needs a documentation :-)
and some cleaning of the API.
> Here is a program which illustrates an unexpected behaviour:
> import Graphics.PDF
> main = runPdf "bug.pdf" standardDocInfo (PDFRect 0 0 100 100) pdf
> pdf = do
> p <- addPage Nothing
> drawWithPage p $ drawText $
> sequence $ replicate 10 $
> text (PDFFont Helvetica 10) 10 10 (toPDFString "ABC")
> What I expect here is "ABC" printed 10 times on the same place
> at (10,10)). What I see (in Okular) is ABC printed each time in the
> place like this:
> What's happening here? I'm using HPDF-1.4.1 from Hackage.
> Roman I. Cheplyaka :: http://ro-che.info/
> "Don't let school get in the way of your education." - Mark Twain
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe