-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fields Not Displaying #939
Comments
Hello @softe1988, Could you please provide a screenshot and sample code? Generated document may help, too. |
Here is the error i get when I try to generate with the state uncommented. If I comment it out state, the pdf attached is what get's generated. The city and zipcode are fine. invoice_pdf.rb class InvoicePdf < Prawn::Document
def initialize(billing, view)
super()
@billing = billing
@view = view
moniker
logo
due
text
due
client_name
address
city
state
zipcode
phone
services
description
cost
fee
total_verbiage
total
payment
thanks
end
def logo
logopath = "#{Rails.root}/app/assets/images/tree_with_roots.jpg"
image logopath, :width => 75, :height => 55
move_down 10
draw_text "Billing Statement For: ", :at => [0, 575], size: 16
stroke_color "0000000"
stroke do
move_down 10
horizontal_rule
end
end
def text
draw_text "Invoice # #{@billing.id}", :at => [0, 600], size: 12
end
def moniker
draw_text "Natural Roots Entertainment", :at => [125, 680], size: 24
end
def client_name
font "Times-Roman"
move_down 10
draw_text "#{@billing.client_name} ", :at => [0, 550], size: 16
end
def address
move_down 10
text_box "#{@billing.address} ", :at => [0, 545],:width => 200, :height => 14, size: 14
end
def city
move_down 10
draw_text "#{@billing.city} ", :at => [0, 520],:width => 100, :height => 14, size: 14
end
def state
move_down 10
draw_text "#{@billing.state} ", :at => [110, 530], size: 16
end
def zipcode
move_down 10
draw_text "#{@billing.zipcode} ", :at => [0, 505],:width => 50, :height => 14, size: 14
end
def phone
move_down 10
draw_text "#{@billing.phone} ", :at => [0, 490], size: 14
end
def due
move_down 10
draw_text " Payment Due Date: #{ @billing.payment_due.strftime('%m/%d/%Y')} ", :at => [300, 600], size: 14
end
def services
move_down 10
draw_text " Description of Services: ", :at => [0, 450], size: 14
end
def description
move_down 10
text_box "#{ @billing.description_of_services} ", :at => [3, 430], :height => 200, :width => 250, size: 14
end
def cost
move_down 10
draw_text " Amount Owed ", :at => [300, 450], size: 14
end
def fee
draw_text "$#{@billing.amount_owed_usd} ", :at => [305, 420], size: 14
stroke_color "0000000"
stroke do
move_down 100
horizontal_rule
end
end
def payment
move_down 10
draw_text "Please visit http://www.naturalroots.tv/payments for secure online payment via Stripe.", :at => [0, 80], size: 14
end
def thanks
move_down 10
text_box "We thank you for choosing Natural Roots Entertainment for your film production needs and we look forward to building a lasting relationship with you.", :at => [0, 60], size: 12
end
def total_verbiage
draw_text " Total Balance ", :at => [0, 180], size: 14
end
def total
move_down 10
draw_text "$#{@billing.amount_owed_usd} ", :at => [300, 180], size: 14
stroke_color "0000000"
stroke do
horizontal_line 0, 500, :at => 200
end
end
end billings_1 (14).pdf |
I would advise against subclassing The reason for that is that |
Prawn::View was made for just this, it's part of the experimental API but it should give you the interface you are looking for. class Greeter
include Prawn::View
def initialize(name)
@name = name
end
def say_hello
text "Hello, #{@name}!"
end
def say_goodbye
font("Courier") do
text "Goodbye, #{@name}!"
end
end
end
greeter = Greeter.new("Gregory")
greeter.say_hello
greeter.say_goodbye
greeter.save_as("greetings.pdf") |
@softe1988 @simonetma Is the issue resolved for you? |
Sorry about that empty message. I haven't had a change to try out the On Tue, Jan 19, 2016 at 3:04 PM, Simone Battiste-Alleyne <
Best Regards, |
@simonetma No problems. I'll close it now. Feel free to reopen if that doesn't solve your issue. |
sounds good thanks! On Tue, Jan 19, 2016 at 3:07 PM, Alexander Mankuta <notifications@github.com
Best Regards, |
I'm creating an invoice and in the client's address, city, state, and zipcode are not being displayed on the page.
The text was updated successfully, but these errors were encountered: