# Regarding PDF Writer

**URL:** <https://www.ruby-forum.com/t/regarding-pdf-writer/123751>\
**Category:** Rails\
**Created:** [December 20, 2007, 10:14am UTC](https://www.ruby-forum.com/t/regarding-pdf-writer/123751 "2007-12-20T10:14:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [December 20, 2007, 10:14am UTC](https://www.ruby-forum.com/t/regarding-pdf-writer/123751/1 "2007-12-20T10:14:02Z")

</div>

Hello guys,  
I have a problem with saving the pdf…  
This is my controller code -------------------

def getpdf  
pdf = PDF::Writer.new  
@room\_event = RoomEvent.find(:all)  
@table=PDF::SimpleTable.new  
@table.column\_order = RoomEvent.column\_names  
data = []  
@room\_event.each do |room\_event|  
data.push({“name” =\> room\_event.name, “description” =\>  
room\_event.description, “id” =\> room\_event.id})  
end  
@table.data.replace data  
@table.render\_on(pdf)  
pdf.save\_as(“public/pdf/hello.pdf”)  
end

There is one more file called getpdf.rpdf in which i havnt put any  
code…

and there is a link in a some other rhtml file which calls this getpdf  
action.  
\<%= link\_to “get pdf”, :action =\> “getpdf” %\>

Now when i click on that link “get pdf” it asks me where to save this  
file. and also it saves the file in pdf folder. but i just want it to  
save in that pdf folder and doesnt want it to ask me explicitly.

Can anyone suggest me any ideas how can i do this… i am very new to  
these concepts…  
Can anyone help??
