I need help getting the sample.pdf to work from here:
http://dry.4thebusiness.com/?document=3
I generates a PDF and I can download it. But I can't open the file as
a PDF. If I change the extension to HTML, I'm getting a Syntax
error. Please help! The following is the error message:
SyntaxError in Report#test_report
Showing report/test_report.rfpdf where line # raised:
compile error
(erb):1: syntax error, unexpected tIDENTIFIER, expecting $end
_erbout = '';
pdf = TCPDF.new()
left_margin = 15
right_margin = 15
pdf.SetMargins(left_margin, 27, right_margin);
pdf.AddPage();
#pdf.SetFont("FreeSans", "", 12);
# pdf.is_unicode = false
text = "Company Name: "
text << @company_name || "Company's Name"
right_margin_from_right_edge = 40
#
# English
#
x = left_margin
y = 10
text_options = {:font => "freesans"}
pdf.draw_title(x, y, "Company Information", text_options)
y += 20
pdf.draw_text(x, y, text, text_options.merge(:font_size => 12))
x1 = left_margin
x2 = 100
y1 = y2 = y + 20
pdf.draw_line(x1, y1, x2, y2, :line_color =>
ReportHelper::RCOLOR_PALETTE[:dark_blue], :line_width => 1)
y += 20
text_block = "Here is a block of text about the company. Here is a
block of text about the company. Here is a block of text about the
company. Here is a block of text about the company. Here is a block of
text about the company. Here is a block of text about the company.
Here is a block of text about the company."
pdf.
^