thanks
Joel
I'm trying to think of where that'd be useful. Can you give me an
example of what you're trying to do?
-greg
I need a way to not generate a doc with tons of template pages not
filled in.
So one idea I had was to add a bunch of template contact pages at the
end of the pdf template, and just delete the ones I dont need and fill
out the rest.
Another idea we had was to use 2 pdf templates, 1 for the main doc and
1 for the additional contact pages, then merge them (not sure if prawn
or anything else ruby can merge 2 docs)
If you have other ideas, I would love to hear them...
thanks
Joel
On Mar 25, 9:40 am, Gregory Brown <gregory_br...@letterboxes.org>
wrote:
> Another idea we had was to use 2 pdf templates, 1 for the main doc and
> 1 for the additional contact pages, then merge them (not sure if prawn
> or anything else ruby can merge 2 docs)
Since we don't yet support templates, it'll be some time before we can
know how to best work with them. That said, I can see where delete_page
could be useful there. With our new page architecture it should be
fairly straightforward, I just need to think through whether any
complications will come up if I do something as simple as
pages.delete_at(index)
> If you have other ideas, I would love to hear them...
pdftk handles merges, I think.
In the context of the templates branch, I could see how this would be a
useful feature. It isn't currently possible, but I think it would be
fairly trivial to implement.
I know Jonathan is keen to introduce support for importing templates on
a page by page basis too, so that would make your second idea viable.
As always with the templates branch, the answer is "hopefully soon" :)
-- James Healy <ji...@deefa.com> Fri, 26 Mar 2010 00:56:55 +1100
# move the PDF from Prawn to CombinePDF
pdf = CombinePDF.parse prawn_pdf.render
# delete any unwanted pages - we will delete the last three pages:
3.times { pdf.remove -1 }
# move the PDF from Prawn to CombinePDF
pdf = CombinePDF.parse prawn_pdf.render
#open the template you are copying from
template_pdf = CombinePDF.load "template_file.pdf"
# copy the pages you need from the template
pdf << template_pdf.pages[0] << template_pdf.pages[1] << template_pdf.pages[5]