Forum: Ruby on Rails PDF::Writer Page Size

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
mwhite (Guest)
on 2005-11-27 08:01
(Received via mailing list)
Hey all,



I've got a question about some strange behavior I'm getting by using the
rpdf handler example that Austin wrote in the RoR wiki
(http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs). I used that
example, and my document generates as expected for the most part.
However,
the page size is different than the page size I get when I just call
PDF::Writer from the command line using an .rb file. I have a document
laid
out pretty exactly (it's a legal document, so they're picky), and the
document when generated using the handler is .23 (8.27 inches wide)
inches
narrower than when generated directly from the command line with the
same
code.  I originally laid out the document by repeatedly generating the
pdf
via the command line, so that's my master. Since the .rpdf generated
document is narrower, my text is wrapping in some unexpected places.
I've
tried setting the paper size to A4 and LETTER, both with the same
behavior.
The page is also .69 inches longer (11.69 inches) than expected.



I can fiddle with the margins, but I just thought I must be doing
something
wrong. I could go back to calling the pdf generator as a library, but I
love
the handler approach. I'd love to keep it if I can. I'm instantiating
the
writer the same way in both places as well, so I'm pretty stumped. I
just
don't see what's different between the two locations, aside from
something
that's deeper than my knowledge of Rails. Has anyone else done this
and/or
have any insight about what could be wrong?



Thanks!



Matt
This topic is locked and can not be replied to.