Solved

using pdf and prawn

Posted on 2011-03-10
3
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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