Questions tagged [prawnto]

a featureful rails plugin leveraging the new kickass prawn library to produce compiled pdf views

a rails plugin providing templating abilities for generating pdf files leveraging the new kick-ass prawn library

full documentation/demos at: http://cracklabs.com/prawnto

Copyright (c) 2008 cracklabs.com, released under the MIT license

77 questions
32
votes
7 answers

header and footer in Prawn PDF

I have read through all relevant posts on Prawn but found no mentioning (even in Prawn's own documentation) of headers and footers. However, I did see a demo on Prawnto's own website about headers and footers. I copied the entire source of that…
Nik So
  • 16,683
  • 21
  • 74
  • 108
23
votes
5 answers

Save a Prawn PDF as a Paperclip attachment?

I'm using Prawn and Prawnto to display a PDF-based reports to the user, but in some circumstances, I'd also like to save the PDF as an attachment to one of my models. I'm using Paperclip for all of my attachments. Does anyone have any suggestions on…
Adam Albrecht
  • 6,680
  • 4
  • 31
  • 35
11
votes
1 answer

Inserting external PDF into Prawn generated document

How can I insert an existing PDF into a Prawn generated document? I am generating a pdf for a bill (as a view), and that bill can have many attachments (png, jpg, or pdf). How can I insert/embed/include those external pdf attachments in my generated…
Lee
  • 686
  • 1
  • 10
  • 23
11
votes
2 answers

Prawn & Prawnto Rails PDF generation - UTF-8?

I'm using ruby, prawn, and prawnto to dynamically generate pdf's containing text in other languages. I can't seem to get any text in languages with non-english characters to show up. It doesn't throw any errors...just shows a bunch of dashes instead…
tybro0103
  • 48,327
  • 33
  • 144
  • 170
9
votes
1 answer

RAILS_ROOT not longer valid when loading images with the prawnto_2 gem

I'm in the process of upgrading my app from Rails 3.0 to Rails 3.1. I've binned my old plugins in favour of gems where possible and that includes replacing the old prawnto plugin with this nice shiny new prawnto_2 gem. Most things seem fine, but I…
Simmo
  • 1,717
  • 19
  • 37
9
votes
3 answers

How to make a bold header in a Prawn table

I'm using Prawn and need to make the Header row bold but I can't find any solution in the API. Here you can see my current table with normal text Headers pdf.table (Data, :header => true) do table.header=(["Header1", "Header2", "Header3",…
Hunter001
  • 231
  • 2
  • 7
6
votes
4 answers

prawnto displaying tables that don't break when new page

I have a variable number of tables with variable number of rows and I want to have them displaying one after the other but if a table doesn't fit on the current page put it on the next then continue on. I have put the table in a transaction so I can…
richard moss
  • 339
  • 1
  • 8
  • 13
5
votes
3 answers

Build a PDF from a template in Ruby on Rails

I would like to create a template in doc, pdf, odt, docx ... document type does not matter. What I want is to get this document, change some values ​​and convert this document to PDF. For example: Take this template: <Date> Hello…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails-3" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails-3'" rel="tag">ruby-on-rails-3</a> <a href="../../questions/tagged/pdf" class="post-tag grid--cell" title="show questions tagged 'pdf'" rel="tag">pdf</a> <a href="../../questions/tagged/pdf-generation" class="post-tag grid--cell" title="show questions tagged 'pdf-generation'" rel="tag">pdf-generation</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Aug 14 '11 at 19:41">asked Aug 14 '11 at 19:41</time> <a href="../../users/839049/nicos-karalis" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/839049.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Nicos Karalis" /> </a> <div class="s-user-card--info"> <a href="../../users/839049/nicos-karalis" class="s-user-card--link">Nicos Karalis</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">3,724</li> <li class="s-award-bling s-award-bling__gold" title="4 gold badges">4</li> <li class="s-award-bling s-award-bling__silver" title="33 silver badges">33</li> <li class="s-award-bling s-award-bling__bronze" title="62 bronze badges">62</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-5161896"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/5161896/how-do-i-specify-a-response-format-based-on-a-form-option-in-rails-3-0-x" class="question-hyperlink">How do I specify a response format based on a form option in Rails 3.0.x</a></h3> <div class="excerpt">Environment: Rails 3.0.4 and Ruby 1.9.2 I have the following form: <%= form_tag( {:action => 'show', :format => :pdf}, :method => :post) do %> .. list of items ... <%= submit_tag "Show", :onclick => "return checkAllFields(4);", :remote => true %>…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/ruby-on-rails-3" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails-3'" rel="tag">ruby-on-rails-3</a> <a href="../../questions/tagged/webforms" class="post-tag grid--cell" title="show questions tagged 'webforms'" rel="tag">webforms</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 01 '11 at 23:55">asked Mar 01 '11 at 23:55</time> <a href="../../users/528638/andy" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/528638.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Andy" /> </a> <div class="s-user-card--info"> <a href="../../users/528638/andy" class="s-user-card--link">Andy</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,801</li> <li class="s-award-bling s-award-bling__gold" title="3 gold badges">3</li> <li class="s-award-bling s-award-bling__silver" title="22 silver badges">22</li> <li class="s-award-bling s-award-bling__bronze" title="33 bronze badges">33</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-2692862"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/2692862/prawn-html-formatting" class="question-hyperlink">Prawn html formatting</a></h3> <div class="excerpt">I have some simple lists and bold/italic text to format with prawn. How do I get prawn to pay attention to the html tags instead of just displaying them explicitly. If prawn can't do this, what are my other options? </div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/ruby" class="post-tag grid--cell" title="show questions tagged 'ruby'" rel="tag">ruby</a> <a href="../../questions/tagged/pdf-generation" class="post-tag grid--cell" title="show questions tagged 'pdf-generation'" rel="tag">pdf-generation</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 22 '10 at 16:59">asked Apr 22 '10 at 16:59</time> <a href="../../users/248423/stevenheidel" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/248423.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="stevenheidel" /> </a> <div class="s-user-card--info"> <a href="../../users/248423/stevenheidel" class="s-user-card--link">stevenheidel</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">820</li> <li class="s-award-bling s-award-bling__silver" title="7 silver badges">7</li> <li class="s-award-bling s-award-bling__bronze" title="20 bronze badges">20</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-2692720"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/2692720/wrap-text-around-an-image-in-rails-and-prawn" class="question-hyperlink">Wrap text around an image in rails and prawn</a></h3> <div class="excerpt">I have a document with dynamic image and dynamic text and would like the text around the image. The image is right aligned on the landscape page. Here is what I have so far: pdf.bounding_box([0,pdf.bounds.top - 50], :width => pdf.bounds.width,…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/ruby" class="post-tag grid--cell" title="show questions tagged 'ruby'" rel="tag">ruby</a> <a href="../../questions/tagged/pdf-generation" class="post-tag grid--cell" title="show questions tagged 'pdf-generation'" rel="tag">pdf-generation</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 22 '10 at 16:39">asked Apr 22 '10 at 16:39</time> <a href="../../users/248423/stevenheidel" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/248423.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="stevenheidel" /> </a> <div class="s-user-card--info"> <a href="../../users/248423/stevenheidel" class="s-user-card--link">stevenheidel</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">820</li> <li class="s-award-bling s-award-bling__silver" title="7 silver badges">7</li> <li class="s-award-bling s-award-bling__bronze" title="20 bronze badges">20</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-16903112"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>4</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/16903112/text-indented-on-the-right-in-pdfs-generated-with-prawn" class="question-hyperlink">Text indented on the right in PDFs generated with Prawn</a></h3> <div class="excerpt">I am using Prawn to render PDFs in my Rails app. For some reason, though, my phone numbers are always indented on the right by 2 (?) spaces. Can anybody tell me what I am missing here? All three values are saved as strings in my SQLite database and…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/ruby-on-rails-3" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails-3'" rel="tag">ruby-on-rails-3</a> <a href="../../questions/tagged/pdf-generation" class="post-tag grid--cell" title="show questions tagged 'pdf-generation'" rel="tag">pdf-generation</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 03 '13 at 18:12">asked Jun 03 '13 at 18:12</time> <a href="../../users/976691/tintin81" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/976691.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Tintin81" /> </a> <div class="s-user-card--info"> <a href="../../users/976691/tintin81" class="s-user-card--link">Tintin81</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">9,821</li> <li class="s-award-bling s-award-bling__gold" title="20 gold badges">20</li> <li class="s-award-bling s-award-bling__silver" title="85 silver badges">85</li> <li class="s-award-bling s-award-bling__bronze" title="178 bronze badges">178</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-1255774"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>3</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/1255774/pdf-generation-with-prawn-and-prawnto" class="question-hyperlink">PDF generation with Prawn and Prawnto</a></h3> <div class="excerpt">Is anyone using Prawn / Prawnto with Jruby on rails? I installed prawn 0.5.01 and rails 2.3.2. I just installed prawn and prawnto and started playing with the PDF generation capabilities. I am concerned that the pranwto web site is no longer…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/pdf-generation" class="post-tag grid--cell" title="show questions tagged 'pdf-generation'" rel="tag">pdf-generation</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/jrubyonrails" class="post-tag grid--cell" title="show questions tagged 'jrubyonrails'" rel="tag">jrubyonrails</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Aug 10 '09 at 16:08">asked Aug 10 '09 at 16:08</time> <a href="../../users/5917/joe-dean" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5917.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Joe Dean" /> </a> <div class="s-user-card--info"> <a href="../../users/5917/joe-dean" class="s-user-card--link">Joe Dean</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">3,356</li> <li class="s-award-bling s-award-bling__gold" title="5 gold badges">5</li> <li class="s-award-bling s-award-bling__silver" title="26 silver badges">26</li> <li class="s-award-bling s-award-bling__bronze" title="31 bronze badges">31</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-10108970"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>4</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/10108970/generating-a-pdf-with-prawnto-that-contains-image-s" class="question-hyperlink">Generating a PDF with Prawnto That Contains Image(s)</a></h3> <div class="excerpt">I did some research into the easiest/best way to generate a pdf in my RoR project and decided upon Prawn + Prawnto. I have successfully got Prawnto producing a very basic PDF using the .prawn extension, however I don't know how to display an image…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/ruby-on-rails-3" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails-3'" rel="tag">ruby-on-rails-3</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 11 '12 at 15:22">asked Apr 11 '12 at 15:22</time> <a href="../../users/1166885/edev-io" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1166885.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="edev.io" /> </a> <div class="s-user-card--info"> <a href="../../users/1166885/edev-io" class="s-user-card--link">edev.io</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">560</li> <li class="s-award-bling s-award-bling__silver" title="5 silver badges">5</li> <li class="s-award-bling s-award-bling__bronze" title="21 bronze badges">21</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-6391637"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>3</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/6391637/prawn-pdf-generation-with-progress-bar-or-spinner" class="question-hyperlink">Prawn: PDF generation with progress bar or spinner</a></h3> <div class="excerpt">I'm using prawn and prawnto for PDF-generation in my rails-app. Is there a way to show the user a spinner or progress bar while the PDF is generated?? I think about showing a spinner-div in the document with the "generate-pdf-link" when starting the…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ruby-on-rails" class="post-tag grid--cell" title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a href="../../questions/tagged/spinner" class="post-tag grid--cell" title="show questions tagged 'spinner'" rel="tag">spinner</a> <a href="../../questions/tagged/progress" class="post-tag grid--cell" title="show questions tagged 'progress'" rel="tag">progress</a> <a href="../../questions/tagged/prawn" class="post-tag grid--cell" title="show questions tagged 'prawn'" rel="tag">prawn</a> <a href="../../questions/tagged/prawnto" class="post-tag grid--cell" title="show questions tagged 'prawnto'" rel="tag">prawnto</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 17 '11 at 20:46">asked Jun 17 '11 at 20:46</time> <a href="../../users/695483/chris-crown" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/695483.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Chris Crown" /> </a> <div class="s-user-card--info"> <a href="../../users/695483/chris-crown" class="s-user-card--link">Chris Crown</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">304</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="13 bronze badges">13</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <div class="s-pagination--item is-selected">1</div> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=3" rel="" title="Go to page 3">3</a> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=4" rel="" title="Go to page 4">4</a> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=5" rel="" title="Go to page 5">5</a> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=6" rel="" title="Go to page 6">6</a> <a class="s-pagination--item" href="../../questions/tagged/prawnto_page=2" rel="next" title="Go to page 2"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>