PDF document viewer in rails

745 views
Skip to first unread message

mahesh s

unread,
Sep 15, 2009, 12:38:55 AM9/15/09
to rubyonra...@googlegroups.com
Hai guys i would like to show my pdf document into my app like scribd site show the document in their site i need a help how to implement the viewer into my app give me some reference for implement the viewer

Sijo Kg

unread,
Sep 15, 2009, 4:26:58 AM9/15/09
to rubyonra...@googlegroups.com
Hi mahesh

Please check
http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000421

An example is
send_file 'filepath', :disposition => 'inline',:type =>
'application/pdf'


Sijo
--
Posted via http://www.ruby-forum.com/.

mahesh s

unread,
Sep 15, 2009, 4:51:07 AM9/15/09
to rubyonra...@googlegroups.com
Hi sijo
thank you  it help me some way but what i really need is i would like to show the content in the flash player like this url shows http://www.scribd.com/doc/18244537/The-World-According-to-Twitter

Thanks & regards
Mahesh

Peter De Berdt

unread,
Sep 15, 2009, 5:10:18 AM9/15/09
to rubyonra...@googlegroups.com

On 15 Sep 2009, at 10:51, mahesh s wrote:

thank you  it help me some way but what i really need is i would like to show the content in the flash player like this url shows http://www.scribd.com/doc/18244537/The-World-According-to-Twitter 

Marnen Laibow-Koser

unread,
Sep 15, 2009, 8:15:34 AM9/15/09
to rubyonra...@googlegroups.com
mahesh s wrote:
> Hi sijo
> thank you it help me some way but what i really need is i would like to
> show the content in the flash player like this url shows
> http://www.scribd.com/doc/18244537/The-World-According-to-Twitter

Don't do this. Scribd's PDF viewer is an impressive piece of Flash, but
it's underpowered compared to real PDF viewers like the Adobe Reader
plugin. Also, iPhone and Palm users can display PDF files but not
Flash, and I think screen readers would have an easier time with PDF
files.

Just serve up the straight PDF file and don't worry about Flash.

>
> Thanks & regards
> Mahesh
>
> On Tue, Sep 15, 2009 at 1:56 PM, Sijo Kg

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Robert Walker

unread,
Sep 15, 2009, 10:15:09 PM9/15/09
to rubyonra...@googlegroups.com
Marnen Laibow-Koser wrote:
> Don't do this. Scribd's PDF viewer is an impressive piece of Flash, but
> it's underpowered compared to real PDF viewers like the Adobe Reader
> plugin. Also, iPhone and Palm users can display PDF files but not
> Flash, and I think screen readers would have an easier time with PDF
> files.
>
> Just serve up the straight PDF file and don't worry about Flash.

+1

Or, at least provide both options to visitors. As a Safari user I don't
even need a plugin to have a great PDF viewing experience (even
surpasses that of the Adobe Reader plugin IMHO). Being forced to view
PDF inside Flash would just serve to irritate me to the point of never
using a site again. Or at least not without a lot of grumbling and
cursing of the site developer.

mahesh s

unread,
Sep 17, 2009, 12:54:04 AM9/17/09
to rubyonra...@googlegroups.com
Thank you for your idea guys
       I got the solution to show the file in iframe tag is that good way to show the file in iframe or any better solution in rails to show the pdf content.

Marnen Laibow-Koser

unread,
Sep 17, 2009, 7:10:56 AM9/17/09
to rubyonra...@googlegroups.com
mahesh s wrote:
> Thank you for your idea guys
> I got the solution to show the file in iframe tag is that good
> way to
> show the file in iframe or any better solution in rails to show the pdf
> content.

It doesn't have to be in an iframe -- you can serve it just like an HTML
file. Rails doesn't come into the issue.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Fernando Alonso

unread,
Mar 11, 2010, 8:58:10 AM3/11/10
to rubyonra...@googlegroups.com
Check
http://googlesystem.blogspot.com/2009/09/embeddable-google-document-viewer.html

It's really simple, and it isn't Flash, just add into the view,
"<iframe
src="http://docs.google.com/gview?url=#{YOUR_PDF_URL}&embedded=true"
style="width:600px; height:500px;" frameborder="0"></iframe>"

Fernando

Reply all
Reply to author
Forward
0 new messages