Solved

using pdf and prawn

Posted on 2011-03-10
3
380 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: narshlob
If you've ever programmed in Ruby and have come across either a proc or a lambda, you might have been wondering what the difference is between the two and when you would use one over the other. This article will try to explain the difference between…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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