Re: Re: Re: PDF::Writer Page Size


#1

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 Z. 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 W. removed_email_address@domain.invalid 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

removed_email_address@domain.invalid

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


#2

On 11/28/05, Matt W. removed_email_address@domain.invalid wrote:

Major props to Austin Z. 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 Z. * removed_email_address@domain.invalid
* Alternate: removed_email_address@domain.invalid