# PDF Viewer

**URL:** <https://www.ruby-forum.com/t/pdf-viewer/178154>\
**Category:** Ruby\
**Created:** [October 29, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/pdf-viewer/178154 "2009-10-29T22:58:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [October 29, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/pdf-viewer/178154/1 "2009-10-29T22:58:33Z")

</div>

I would like to create an embedded pdf viewer on a website that would  
allow visitors to view online documents but prevent them from  
downloading and saving them. Is there a way to do with Ruby?

–  
Kind Regards,  
Rajinder Y.

[http://DevMentor.org](http://DevMentor.org)

Do Good! - Share Freely, Enrich and Empower people to Transform their  
lives.

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [October 29, 2009, 11:05pm UTC](https://www.ruby-forum.com/t/pdf-viewer/178154/2 "2009-10-29T23:05:01Z")

</div>

Rajinder Y. wrote:

> I would like to create an embedded pdf viewer on a website that would  
> allow visitors to view online documents but prevent them from  
> downloading and saving them. Is there a way to do with Ruby?

This is really in the realm of client-side development, so you’d have to  
use Flash, a Java applet, or (maybe) JavaScript. But don’t do this,  
since it will make life difficult for your users – instead, set  
appropriate restrictions on your PDF file.

And be aware that users will bypass the restrictions you set. 🙂

> –  
> Kind Regards,  
> Rajinder Y.
> 
> [http://DevMentor.org](http://DevMentor.org)

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [October 30, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/pdf-viewer/178154/3 "2009-10-30T23:01:04Z")

</div>

2009/10/29 Rajinder Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I would like to create an embedded pdf viewer on a website that would  
> allow visitors to view online documents but prevent them from  
> downloading and saving them. Is there a way to do with Ruby?

It’s physically impossible, regardless of what various  
DRM/DMCA/whatnot activists would like people to believe.

You see the document so you can save it. You can make the actual file  
inaccessible but the information contained in the file is presented on  
the screen so the user can, at the very least, copy it with a camera.

The rest is just question of inconveniencing the people who would want  
to make a permanent copy of the document as well as people who just  
want to view it. It’s much easier to view documents offline than  
online because offline viewing allows for greater resolution  
(printouts), internet connection independence (and thus greater  
location independence), etc.

There is no copy protection scheme known to me that would protect any  
data worth at least a few dollars but many that can inconvenience the  
user, to the point that users of legal copies seek unprotected  
“pirated” copies to access the data for which they bought a license.

Thanks

Michal

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [October 30, 2009, 11:05pm UTC](https://www.ruby-forum.com/t/pdf-viewer/178154/4 "2009-10-30T23:05:45Z")

</div>

On 2009-10-30, Michal S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You see the document so you can save it. You can make the actual file  
> inaccessible but the information contained in the file is presented on  
> the screen so the user can, at the very least, copy it with a camera.

More generally:

Since you’re displaying it on the user’s machine, the data being  
displayed  
have been downloaded to the user’s machine.

It’s over.

And yes, the annoyance value trumps any hypothetical security.

-s
