App crashs on opening the PDF for second time
I have method which generates a pdf and opens it when the method is called.
generate_pdf()
file_location =
File.join(Rho::RhoApplication.get_app_path('public')+'pdfs/',
File110.pdf')
System.open_url(file_location)
Now on the generate_pdf() i have,
pdf = PDF::Writer.new
x = pdf.absolute_left_margin - 10
y = pdf.absolute_top_margin - 10
pdf.add_text(x,y,"Hello World",20)
file_location =
File.join(Rho::RhoApplication.get_app_path('public')+'pdfs/',
File110.pdf')
pdf.save_as(file_location)
So the above code runs only for the first time. On second click the app
crashes. What's wrong with the code ?
No comments:
Post a Comment