Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

using pdf and prawn

Hello
First time trying to use PDF (playtime) - see below and should be self explanatory.

require 'prawn'

ma=[1,2,3,4]
maa=[]
ma.each{|z| maa<<z}

mt=[]
File.open("c:/t.txt").each do
      |z| mt<<z
end

Prawn::Document.generate("c:/simple_table.pdf") do

text "the array values are #{ma}"
text "\n"
text "#{mt}"
text "\n"

start_new_page  
text "bai"  
start_new_page  
text "-- Hai again"  
number_pages "<page> in a total of <total>", [bounds.right - 50, 0]  
end
#####################
Output to PDF is as ....
the array values are [1, 2, 3, 4]

["the rain in Spain\n", "falls mainly on the plain\n", "when will\n", "you ever learn"]

What I want is ....

the array values are [1, 2, 3, 4]

the rain in Spain
falls mainly on the plain
when will
you ever learn
0
philsivyer
Asked:
philsivyer
  • 2
1 Solution
 
lusfernandosCommented:
Hi,

  Some time back I started using prawn. I got it working, however  I decided to changed and use wicked pdf. I believe it was the best thing I did.
  While you are still evaluating, please take a look at:
http://mileszs.com/blog/2009/06/17/wicked-pdf-plugin.html
0
 
philsivyerAuthor Commented:
Thanks
0
 
lusfernandosCommented:
thank you for the points. Hope it helped you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now