Merging multiple PDF documents into one

583 views
Skip to first unread message

Peter Woolcock

unread,
Jun 29, 2011, 1:32:11 PM6/29/11
to Prawn
How do you merger multiple pdf documents into one document. I've been
playing with the template samples but can't seem to figure out how you
merge multiply pdfs into one new document. Is there a way when calling
start_new_page to pass the entire document to the :template option? By
default it only takes the first page but I need it to pass all pages.

Brad Ediger

unread,
Jun 29, 2011, 4:44:40 PM6/29/11
to prawn...@googlegroups.com

Unfortunately, Prawn doesn't support merging multiple PDFs. Templates
are designed to let you use a PDF as a starting point when you want to
do additional drawing through Prawn. You can look into software like
pdftk if you want a general-purpose PDF slicing-and-dicing tool.

Brad

Peter Woolcock

unread,
Jun 29, 2011, 5:04:43 PM6/29/11
to prawn...@googlegroups.com
Any chances of a future release supporting this maybe by inserting the entire document instead of the first page as default behavior? Also, it would be great if :template_page took a range like 1..10. That way you can insert multiple pages rather than only 1.

PW

Daniel Nelson

unread,
Jun 30, 2011, 7:27:32 AM6/30/11
to prawn...@googlegroups.com
On Wed, Jun 29, 2011 at 4:04 PM, Peter Woolcock <wool...@gmail.com> wrote:
> Any chances of a future release supporting this maybe by inserting the
> entire document instead of the first page as default behavior? Also, it
> would be great if :template_page took a range like 1..10. That way you can
> insert multiple pages rather than only 1.

Prawn templates do insert multiple pages from the source document, not
just a single page.

-Daniel

Peter Woolcock

unread,
Jun 30, 2011, 9:02:24 AM6/30/11
to prawn...@googlegroups.com
Do you have a sample of How to combine multiple PDFs using templates?

Sent from my iPhone

Daniel Nelson

unread,
Jun 30, 2011, 10:15:42 AM6/30/11
to prawn...@googlegroups.com
>> On Wed, Jun 29, 2011 at 4:04 PM, Peter Woolcock <wool...@gmail.com> wrote:
>>> Any chances of a future release supporting this maybe by inserting the
>>> entire document instead of the first page as default behavior? Also, it
>>> would be great if :template_page took a range like 1..10. That way you can
>>> insert multiple pages rather than only 1.
>>
>> Prawn templates do insert multiple pages from the source document, not
>> just a single page.

On Thu, Jun 30, 2011 at 8:02 AM, Peter Woolcock <wool...@gmail.com> wrote:
> Do you have a sample of How to  combine multiple PDFs using templates?

My post was in response to your comment about multiple pages, not multiple PDFs.

-Daniel

Uwe Kubosch

unread,
Jun 30, 2011, 5:40:45 AM6/30/11
to prawn...@googlegroups.com


What will this do?

pdf = Prawn::Document.new :template => 'path/to/first/pdf' do
start_new_page :template => 'path/to/second/pdf'
end


--
Uwe Kubosch
Systems Developer
Datek Wireless AS
u...@datek.no
http://datek.no/

Reply all
Reply to author
Forward
0 new messages