On 10/23/05, Brutyn Nick
<brutyn_nick-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:> > As an alternative, you can use PDF::Writer.
> hey, yeah i already tried that, there the images work, but i have a
question
> about that, it seems that u can only set text in a certain way, not by the
x, y
> position.
>
> Like if u want text on position x = 100 y =200, or am i wrong??
>
> Cuz i need to make a pdf document, not a normal text file but in the like
of an
> id card.
Extensively discussed in the 96-page manual[0] and my Ruby Code &
Style[1] article.
There are three methods available for writing text:
#text
#add_text_wrap
#add_text
These names will probably evolve for PDF::Writer 2.0, but essentially
the first flows text onto the page. It won''t guarantee you an X
position, but you can set the Y position and it will flow from there.
The second and third accept (x, y) coordinates. The second would be
better named "#add_partial_text" as it will add text until the maximum
width you have requested and return the remainder. It''s semi-smart
about wrapping, and I expect to be able to add full hyphenation
support in the future. The third will simply write text blindly. Both
the second and the third can also write your text at angles.
Since you''ve probably installed PDF::Writer with gems, I recommend
downloading the demo package and looking over the code there; you''ll
find it interesting.
There are some issues with external fonts that I''m trying to resolve,
but don''t expect to do so before mid-November or early-December. There
will be an updated release in the near future that fixes some minor
bugs that have been found.
-austin
[0] Generate it with the "techbook" command, no other arguments.
[1] http://artima.com/rubycs/pdf_writer.html
--
Austin Ziegler * halostatue-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
* Alternate: austin-/yODNl0JVVCozMbzO90S/Q@public.gmane.org