Prawn Margins Changing Mid Document

128 views
Skip to first unread message

Aristata

unread,
Apr 19, 2012, 11:17:29 AM4/19/12
to Prawn
Hello Everyone,

I have a client that has some pretty crazy needs for their PDF
rendering via their website. They basically want to turn every page
into a pdf. Now each of these pages has a sidebar, which should appear
in the PDF along with the main content on the right side of it in the
document.

What I expect to happen here is that the following page after the
sidebar has been rendered, the text should expand the full width of
the page, rather than just up to the sidebar. The sidebar will always
be unknown in height, so I have to mark the page where it ends, and
then the following page have the main content full width.

Here is a sample pastie of my problem:
http://pastie.org/3817221

If anyone can help please do this has been boggling me for weeks!

Lenny Marks

unread,
Apr 19, 2012, 11:40:54 AM4/19/12
to prawn...@googlegroups.com

On Apr 19, 2012, at 11:17 AM, Aristata wrote:

> Hello Everyone,
>
> I have a client that has some pretty crazy needs for their PDF
> rendering via their website. They basically want to turn every page
> into a pdf.

I love Prawn, but something like wicked_pdf may be better suited for that.

https://github.com/mileszs/wicked_pdf

Aristata

unread,
Apr 19, 2012, 11:45:11 AM4/19/12
to prawn...@googlegroups.com
Haha, well, if we hadn't spent months doing it this way to get it working I wouldn't be very opposed to that, this really is the only issue we have left to sort out. I basically just need to change the page margins on a per page basis through the start_new_page method, and it 'appears' to be working, but the text that should be extending the full width of the page when the margins are back to normal (36, 36, 36, 36) is still the width it is on the first page with the sidebar.
Reply all
Reply to author
Forward
0 new messages