This week's book giveaways are in the Angular and TypeScript and Web Services forums.
We're giving away four copies each of Programming with Types and The Design of Web APIs and have the authors on-line!
See this thread and this one for details.
Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Web based PDF viewer with download restriction

 
Sheriff
Posts: 6447
1155
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this client who wants to embed a PDF ebook on a web page, which is behind a paywall. Basically, after you make a payment, you can read the ebook content on that web page.

I can simply embed the PDF file using an <object> tag, but that would make it pretty easy for someone who has access to that page to pirate the ebook by downloading the raw PDF file.

I also tried a few PDF embedding tools that I could find online, but they all had the same problem - people can easily figure out a way to download the ebook as a PDF file.

Does anyone know a good web based PDF viewer that can prevent or at least make it harder to download the raw PDF file?
 
Saloon Keeper
Posts: 5978
154
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could break down the PDF and serve it page by page. Or serve each page as image, although personally I would chafe at that particular option.

To expand a bit more on that: There isn't really a concept of a PDF-viewer-in-a-browser any more. There was, in the day of Flash etc., but those sorts of client-side technologies are gone. So it's up to the browser to do something with the PDF, and that may be downloading (and storing locally) it outright. Even if the browser can display PDFs, most (or all) offer a download option. So the best bet is not to display it in its entirety at all, but break it down into smaller pieces - chapters, pages, or whatever makes sense in your context and is still secure enough for your purposes. ("Secure" really meaning "obscure" here, just to slow down an attacker enough to annoy him.)
 
Saloon Keeper
Posts: 21437
143
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:To expand a bit more on that: There isn't really a concept of a PDF-viewer-in-a-browser any more. There was, in the day of Flash etc., but those sorts of client-side technologies are gone.



Actually, no. Microsoft Internet Explorer leveraged their OLE technology to provide a general program-in-a-browser capability. Not just PDFs, but Excel, Word, pretty much anything.

However that particular idea had been patented by someone else. They sued Microsoft for half a billion dollars. Microsoft lost. So Microsoft removed that ability.

As it happens, the patent-holders were willing to be more accommodating to non-IE users, but few were willing to opt in after that anyway. The patent is long expired, but like Java Applets, it's not something anyone wants to deal with anymore.

You can use a number of means to pick apart a PDF and display it page by page in a browser window, but it's wasted effort. Even if you reduce the page to a raw bitmap, once it goes out to the client,  the page can be captured and the PDF can be reconstructed. OCR works real good on computer display images. If the user can read it, someone can steal it.

I've said it before, but I'll repeat it again. Locks - as any locksmith can attest - are for honest people. Slapping "copy protection" on products is only seen as an opportunity for fun by pirates, but will annoy honest purchasers, and if it's extreme enough, will even drive them away. You'll see more profit from taking all that labor aimed at anti-piracy and applying it to making a product that people will want to pay for, and there are stats to back that up.

As for me, I've disabled the "buy" feature in my Nook reader because Barnes & Noble doesn't support copying ebooks even when the publisher sold them explicitly without copy protection (which probably violates their license). I now buy my O'Reilly books and their like from alternative vendors that allow me to download my purchased copy to storage of my choosing, not the bookseller's.
 
Marshal
Posts: 24820
60
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example of what Tim means: there's a newspaper called the Globe and Mail in Toronto. Every Christmas they publish a giant crossword puzzle and publish it in PDF form. The website says it's only available to subscribers, and it enforces that rule. But it's not hard to get the direct link to the PDF and that isn't secured. (That's how I got my copy.)
 
Tim Holloway
Saloon Keeper
Posts: 21437
143
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, the only copy protection worth anything for PDF's is to generate encrypted copies where each copy has its own unique decryption key.

It won't prevent downloading, but if an honest person gives away a downloaded copy+key, you've got a watermark proving where it came from. A dishonest person would, of course, remove that promptly.
 
Tim Moores
Saloon Keeper
Posts: 5978
154
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Tim Moores wrote:To expand a bit more on that: There isn't really a concept of a PDF-viewer-in-a-browser any more. There was, in the day of Flash etc., but those sorts of client-side technologies are gone.



Actually, no. Microsoft Internet Explorer leveraged their OLE technology to provide a general program-in-a-browser capability. Not just PDFs, but Excel, Word, pretty much anything.

However that particular idea had been patented by someone else. They sued Microsoft for half a billion dollars. Microsoft lost. So Microsoft removed that ability.

As it happens, the patent-holders were willing to be more accommodating to non-IE users, but few were willing to opt in after that anyway. The patent is long expired, but like Java Applets, it's not something anyone wants to deal with anymore.


In other words: Actually, yes :-) Unless you really want to differentiate between "the concept doesn't exist any more" and "implementations of the concept don't exist any more", in which case you would have a point. But we're talking about actual possibilities here, so the difference is academic.
 
Tim Holloway
Saloon Keeper
Posts: 21437
143
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hardly academic. If anything, the PDF-in-browser was before the days of Flash. And it had nothing to do with Flash. As I said, it was based on OLE/DCOM. If anyone actually did a Flash plugin, I don't know about it, and it would probably have met the same fate as OLE-based embedded PDF viewers.

Modern-day "in-browser" PDF viewers are AJAX-based and noticeably different from the OLE presentation to even the most casual eye.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!