Forum: Ruby on Rails Re: Re: 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-28 16:13
(Received via mailing list)
Hey Dave,



Thanks for the info... I actually managed to figure it out! It seems
that if
you don't ensure that the view renders without a layout, this problem
can
occur. Thanks to the Rails wiki for this handy piece of info. So, at the
end
of my generate method in my controller I just put:



render :layout => false (previously called render_without_layout, but
now
deprecated)



Everything snapped back into place in my layout, and the page size is as
expected.



Major props to Austin Ziegler for that template handler code... That's
hands-down the coolest means of handling pdf generation that I've seen
in
Rails.



Matt



>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.



>On 11/27/05, Matt White <mwhite@page16.com> wrote:

>>

>>

>>

>> 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

>> _______________________________________________

>> Rails mailing list

>> Rails@lists.rubyonrails.org

>> http://lists.rubyonrails.org/mailman/listinfo/rails

>>

>>
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 halostatue (Guest)
on 2005-11-28 16:17
(Received via mailing list)
On 11/28/05, Matt White <mwhite@page16.com> wrote:
> Major props to Austin Ziegler for that template handler code... That's
> hands-down the coolest means of handling pdf generation that I've seen in
> Rails.

To be fair, I didn't add that. Someone else did -- I don't know whom.
I don't do any rails development myself, but I pay attention to the
Rails list to try to help with problems like yours.

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