Displaying 8 results from an estimated 8 matches for "select_font".
2007 Apr 16
7
pdf-file tot desktop with pdf/writer problem
Hi,
I''m using pdf/Writer to generate a pdf-file, but whatever I do, it
gets saved in folder of my app, and not on the users desktop.
I''ve used
   pdf = PDF::Writer.new
           pdf.select_font "Times-Roman"
           pdf.text "Hello.pdf", :font_size => 12, :justification
=> :left
           File.open("hello.pdf", "wb") { |f| f.write pdf.render }
and Ive used
_pdf = PDF::Writer.new
          _pdf.select_font "Times-Roman"...
2006 Mar 10
5
PDF::Writer Simpletable Iteration
...n I can find only deals with static data, 
manually entered in the controller when using the Simpletable class. It 
is working, except only the last item in the collection shows in the 
generated PDF. Any ideas?
My code follows:
def pdf
    @item = Item.find(:all)
    _p = PDF::Writer.new
    _p.select_font ''Times-Roman''
    PDF::SimpleTable.new do |tab|
      tab.title = "Item List"
      tab.column_order.push(*%w{item_code item_name item_desc 
item_cost})
      tab.columns["item_code"] = 
PDF::SimpleTable::Column.new("item_code") { |col| col.heading...
2006 Jun 13
2
Top margin on PDF generated with PDF::Writer
...a PDF document with some images and text. This is the code on
my controller:
def pdf
  gen_pdf
  redirect_to("#{@request.relative_url_root}/pdf/cupones.pdf")
end
private
def gen_pdf
  pdf = PDF::Writer.new(:paper => "A4")
  pdf.margins_cm(0)
  pdf.start_columns(2, 0)
  pdf.select_font "Times-Roman"
  10.times do
    pdf.open_object do |card|
      pdf.save_state
      pdf.image "public/images/card.png", :justification => :left,
:width => PDF::Writer.cm2pts(10.5), :height => PDF::Writer.cm2pts(6)
      #pdf.add_text_wrap(0, pdf.y, PDF::Writer.cm2pts(1...
2008 Mar 13
0
Template being ignored when attaching pdf in e-mail
...pe => "application/pdf", :filename =>
"notice.pdf", :transfer_encoding => "send_pdf" do |a|
      a.body = generate_pdf(notice_request)
    end
  end
  def generate_pdf(notice_request)
      pdf = PDF::Writer.new(:paper => "LETTER")
      pdf.select_font ''Times-Roman''
      pdf.text "HELLO WORLD", :font_size => 17, :justification
=> :center
      pdf.move_pointer(5)
      pdf.render :filename => ''NoticeRequest.pdf'', :type =>
''application/pdf''
    end
end
--~--~------...
2006 Nov 04
0
UTF-8 String to PDF using PDF::Writer
...y latest attempt.
def create_pdf
    # creates a PDF version of an authors listing. Pass a listing  
object as the methods parameter. AJ
      #
      pdfOfListing = PDF::Writer.new # defaults to a US Letter,  
portrait, PDF version 1.3 document. AJ
      pdfOfListing.compressed
      pdfOfListing.select_font(''Times-Roman'', {:encoding =>  
''MacRomanEncoding''})
      pdfOfListing.text(Iconv.conv("UTF-8", "MacRoman",  
chapter.chapter_body), :font_size => 12, :justification => :left))
      send_data(pdfOfListing.render, :filename =>  
li...
2009 Jan 27
6
German letter ä, ö, ü in rfpdf
Hi,
I need PDF creation in Rails and decided for RFPDF.
Everything works quite nice the only problem is that I can''t display
ä,ö,ü in the pdf documents.
I found a tutorial that says that I have to create a font config file
with MakeFont.
I did it, but now I don''t now where to put al this files.
Does anyone has experience with creating PDFs in Rails with ä,ü,ö
letters?
Thx
2006 May 05
8
pdf/writer: table.render_on best practices?
...enerate a pdf report that contains a table. The report is 14 pages, and
it takes 20s to be rendered. Most of these 20s are spend in the render_on
method. I wonder if it is possible to speed up that process?
To create the report, I do the following:
1) Setup pdf layout:
# Setup pdf layout
      pdf.select_font("Helvetica", { :encoding => "WinAnsiEncoding"})
      pdf.text " ", :font_size => 12, :justification => :center
      s = 9
      t = ''Seite <PAGENUM>''
      y = pdf.absolute_bottom_margin - 5
      x = pdf.absolute_right_margin
      x...
2005 Dec 15
5
Avery Lables, PDF::Writer or LaTex?
In a new app we are developing, we need to be able to dynamically create 
a PDF and send it to the browser (inline with send_data). I have been 
tinkering with PDF::Writer and love the simplicity and native ruby-ness 
of it all.
However, one of the main uses for this functionality is to output a PDF 
of addresses to be printed on Avery 5161 labels. LaTex seems to be 
suited well for this, but it