Forum: Ruby on Rails Re: 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.
C7cf0af698ddd44c30908762640262fd?d=identicon&s=25 mwhite (Guest)
on 2005-11-27 07:21
(Received via mailing list)
More info. Looks like the size problem arises when the document is
generated
by calling pdf.render and sending the output directly to the browser
instead
of writing an intermediate file using save_as. I'd really hate to have
to
deal with temp files.



I suppose it might be a bug. I guess I may just have to work around it
for
now.



Matt
F3dc06f587d1ff4c7366b102bfda9204?d=identicon&s=25 monch1962 (Guest)
on 2005-11-28 06:11
(Received via mailing list)
For what it's worth, if you didn't already know, 11.69x8.27 inches is
the exact size of an A4 page.

Have you checked your printer settings to see if it defaults to A4
paper?  Maybe PDF:Writer is picking up its settings from a printer,
for some reason...

I'm probably going to start using PDF::Writer myself in the next day
or so.  Even though I want it to default to A4 page size, I'm curious
about what you're seeing.

Regards

Dave M.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 halostatue (Guest)
on 2005-11-28 14:20
(Received via mailing list)
On 11/28/05, David Mitchell <monch1962@gmail.com> wrote:
> For what it's worth, if you didn't already know, 11.69x8.27 inches is
> the exact size of an A4 page.
>
> Have you checked your printer settings to see if it defaults to A4
> paper?  Maybe PDF:Writer is picking up its settings from a printer,
> for some reason...

No, it won't be doing that. PDF::Writer is written entirely in Ruby.
My suspicion is that there's something in Matt's code which is
creating the document with an A4 size, e.g.:

  pdf = PDF::Writer.new(:paper => "A4")

PDF::Writer creates its pages from the exact number of *points* (about
1/72 of an inch) and the named paper sizes are merely for convenience.

If PDF::Writer is not given a paper size as above, it will always
asssume LETTER (U.S. Letter, 8.5" x 11").

-austin
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca
This topic is locked and can not be replied to.