Displaying 3 results from an estimated 3 matches for "absolute_top_margin".
2006 Jun 13
2
Top margin on PDF generated with PDF::Writer
Hi,
A little question. I''ve written a method that uses PDF::Writer to
generate 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
2006 May 05
8
pdf/writer: table.render_on best practices?
...do |heading|
pdf.save_state
pdf.stroke_color! Color::Black
pdf.stroke_style! PDF::Writer::StrokeStyle::DEFAULT
s = 9
t = "My title - " + Date.today().to_s
w = pdf.text_width(t, s) / 2.0
x = pdf.margin_x_middle
y = pdf.absolute_top_margin
pdf.add_text(x - w, y, t, s)
x = pdf.absolute_left_margin
w = pdf.absolute_right_margin
y -= (pdf.font_height(s) * 1.01)
pdf.line(x, y, w, y).stroke
y = pdf.absolute_bottom_margin + pdf.font_height(9) - 2
pdf.line(x, y, w, y).stroke...
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