Questions tagged [prawn]

Prawn is a fast, nimble Ruby library for creating PDF files.

15
votes
3answers
9k views

Rails, Prawn - PDF show up in browser & etc

I'm trying to understand the Prawn pdf gem.I was able to make it generate a pdf. Every gem in the gemfile included:gem 'mysql', '~> 2.8.1'gem 'prawn', '~> 0.12.0'gem 'pdf-reader', '~> 0....
29
votes
7answers
26k views

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 ...
11
votes
5answers
14k views

Generate pdf from Rails 3 - what tool to choose?

I need to be able to render some views as PDFs from a Rails 3 project. I've never before used PDF generation techniques with ruby/rails, so I researched a few popular approaches such as Prawn and PDF::...
2
votes
4answers
2k views

Rails PDF Generation with Prawn in IE7

I'm using Prawn and Prawnto to generate a PDF in a Ruby on Rails app (Rails version 2.2.2) which works great and generates PDFs happily and sends them to the user to download in Firefox.The problem ...
7
votes
3answers
3k views

Rails 3 Render Prawn pdf in ActionMailer

How to render prawn pdf as attachment in ActionMailer? I use delayed_job and don't understand, how could I render pdf-file in action mailer (not in controller). What format should I use?
5
votes
3answers
2k views

prawn PDF: I need to generate nested tables

I need a table where rows are actually 2 rows tables, a nested table that is..How can I do that in prawn? Maybe I need an extension.. but which one?
0
votes
3answers
2k views

Prawn gem: How to create the .pdf from an *existing* file (.xls)

Can anybody show me (maybe copy/paste a simple code example) how to create the .pdf file from an existing (.xls) file, using the Prawn gem? (Basically, I'd need the command that "opens" the existing ...
12
votes
2answers
8k views

Unable to render PDF to browser using Prawn PDF for Ruby on Rails

I am creating a pdf file in the latest version of the Prawn library (v1.0.1rc) in Rails (3.1.1) and when I run my code it generates the PDF into the root of the application.I don't want this. I want ...
11
votes
2answers
5k views

Prawn pdf attachments in the email

In my Rails application, I'm trying to attach the invoice to the email:def invoice(invoice)attachment :content_disposition=> "attachment",:body=> InvoicePdf.new(invoice),...
21
votes
5answers
8k views

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 ...
16
votes
5answers
5k views

Watermark in existing PDF in Ruby

I would like to add a dynamically generated text. Is there a way to watermark an existing PDF in Ruby?
10
votes
2answers
8k views

How many fonts are available in Prawn?

I've been randomly trying fonts in Prawn, for Ruby. For Example:Times New Roman - YesPalatino Linotype - NoIs there a list of which fonts are available and which aren't?
5
votes
4answers
4k views

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 ...
11
votes
1answer
8k views

Add image in pdf using Prawn

I've a problem for adding images into a PDF using Prawn as pdf generator. I'm trying to add image using the following code:def headertext "something"image "#{Prawn::DATADIR}/images/logo_small....
10
votes
7answers
4k views

Using lists in prawn

Im using prawn to create pdfs that contain much data in table format and some lists. The problem with the lists is that Im just using text as lists because there is no semantic equivalent to ul > li ...
9
votes
2answers
6k views

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 ...
9
votes
2answers
1k views

rails gem prawn, image and anchor

Can you tell me how to insert image which will be a link to for example page 20? I know how to make with normal text:text "<link anchor='page20'>Go to page 20</link>", :inline_format=>...
4
votes
1answer
1k views

Prawn doesn't seem to push layout down when using repeat(:all)

I am generating a document with data that flows onto each subsequent page, each page has a standard header. However, when I use repeat(:all) to put the header on each page, I find that on every page ...
6
votes
2answers
2k views

Background images using prawn on all pages

I have this code in the viewprawn_document(:page_size=> "A4", :top_margin=> 80, :bottom_margin=> 40,:background=> "public/uploads/1.png") do |pdf|creation_date=...
5
votes
2answers
3k views

Any font for generating pdf that will handle Chinese, Cyrillic… ?

I'm creating generator of pdf documents in Ruby on Rails with Prawn gem and I came up with issue that when I have Chinese, Japanese and Cyrillic chars they are displayed incorrectly. I googled out ...
4
votes
2answers
696 views

My text is written in a bad direction when I use a template

I want to add a text on an existing PDF using Rails, so I did : filename="#{Rails.root}/app/assets/images/sample.pdf"Prawn::Document.generate("#{Rails.root}/app/assets/images/full_template.pdf", :...
3
votes
0answers
1k views

Start new page automatically when using stacked bounding boxes in Prawn

I want to simulate the behaviour of a table in Prawn, but can't use table because of the limitation of things I can draw inside cells.So I am using bounding boxes in order to create contexts for the ...
11
votes
3answers
3k views

How to handle a file_as_string (generated by Prawn) so that it is accepted by Carrierwave?

I'm using Prawn to generate a PDF from the controller of a Rails app,...respond_to do |format|format.pdf dopdf=GenerateReportPdf.new(@object, view_context)send_data pdf.render, ...
9
votes
1answer
7k views

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 ...
5
votes
3answers
4k views

Generating a PDF With Images from Base64 with Prawn

I am trying to save multiple pngs in one pdf. I'm receiving the PNGs from an API Call to the Endicia Label Server, which is giving me a Base64 Encoded Image as response.Based on this Question:How ...
4
votes
1answer
899 views

generating pdf using prawn in background with resque

I am trying to create a PDF document in the background via Resque background job.My code for creating the PDF is in a Rails helper method that I want to use in the Resque worker like:class ...
4
votes
3answers
4k views

Prawn html formatting

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 ...
3
votes
2answers
1k views

Is there any options to customize stroke_bounds? (Rails Prawn)

I want to draw borders for all the pages in my PDF. But while using stroke_bounds, I can only draw single dark lined borders alone. I couldn't customize anything?Does anybody have any idea on how to ...
3
votes
2answers
3k views

Ruby - How to use different fonts in Prawn?

I have a small Ruby program where I'm printing some text out to a PDF using Prawn, but a small portion of the text is non-English characters. (Some of that text is Chinese, some is Greek, etc.). When ...
2
votes
1answer
2k views

Printing prawn generated pdf

Using prawn gem for ruby-on-rails webpage, is it possible to send print request to printer device to print pdf page I've generated using prawn?

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,