Solved

using pdf and prawn

Posted on 2011-03-10
3
374 Views
Last Modified: 2012-05-11
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
Comment
Question by:philsivyer
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
lusfernandos earned 500 total points
ID: 35097962
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
 

Author Closing Comment

by:philsivyer
ID: 35139462
Thanks
0
 
LVL 2

Expert Comment

by:lusfernandos
ID: 35140572
thank you for the points. Hope it helped you.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I recently rediscovered rails when I needed a holiday project and decided to build a management dashboard for the company where I work.  With it being a project done in my free time, I could focus my time on learning the basics rather than trying to…
In Ruby, Call or invoke a API DLL library is easily via Win32API class, win32-api gem or other gems. For general DLL API call, there are quite a few references, some good tips list below: http://www.rubytips.org/2008/05/13/accessing-windows-api-fro…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now