good evening

i have a question plz .

i wanna to display a link in my web site

when the user click on it a pdf file is opened in the browser.

but i dont want the user to print or copy or use "save as" properties

is there are any php function or codes can do this

sorry for my broken English :icon_redface:


thanks a lot in advance

I'll leave it to someone else to address the print question, but about copying and saving - it's impossible to restrict this. If the browser can see the PDF data, it can be downloaded to the computer.

thanks edwin

but i know that there is a solution for this in asp.net

so i supposed that php also can do it

thanks again

really appreciate your reply

Member Avatar for diafol

I think you can restrict certain actions for pdf, but only if you are the author. I believe you do this with the save options. I don't have Adobe Acrobat, so I can't comment further. There are a few pdf creator freeware programs, but I don't know if they have a disable print/save function.

BTW: do you have an url for the asp script? It may be possible to port it to php - you never know.

I'm sure printing can be restricted, but the save as copy simply can't because if I can read the bytes and store them in memory (in order to display the PDF), I can store them on disk. THat's nothing to do with the PDF itself. It's at the dat level underneath that.

If you can show me a PDF on a site which claims that it cannot be saved, post the URL here and I'll be happy to demonstrate how I can save a copy.

I'm sure printing can be restricted, but the save as copy simply can't because if I can read the bytes and store them in memory (in order to display the PDF), I can store them on disk. THat's nothing to do with the PDF itself. It's at the dat level underneath that.

If you can show me a PDF on a site which claims that it cannot be saved, post the URL here and I'll be happy to demonstrate how I can save a copy.

True, "display in the browser" downloads a copy in the TIF, you can drag that copy anywhere
I have Acrobat, not reader, and can add restrictions on printing, but screen capture utilities can override that

hey guys have seen this about the image the images on couple of the websites which on right click on the image alerts "Copyright violated, copying restricted" etc. and does not allow the user to copy it.
But I am still not sure how to do this.

guys what about this -

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

None of this prevents people from copying images. It just means they can't do it via right-clicking. But there's nothing stopping them from dragging and dropping and image from the browser to the desktop, or disabling Javascript and then right-clicking to do a "save target", or to download the image by visiting the Activities window.

Again - here's a challenge: show me a Website that attempts to prevent people stealing their images, and I'll demonstrate how I can get them.

None of this prevents people from copying images. It just means they can't do it via right-clicking. But there's nothing stopping them from dragging and dropping and image from the browser to the desktop, or disabling Javascript and then right-clicking to do a "save target", or to download the image by visiting the Activities window.

Again - here's a challenge: show me a Website that attempts to prevent people stealing their images, and I'll demonstrate how I can get them.

sure,I will love to play around with it.here it is that.
Note the image in the gallery in the upper part of it -
http://timesofindia.indiatimes.com/

sure,I will love to play around with it.here it is that.
Note the image in the gallery in the upper part of it -
http://timesofindia.indiatimes.com/

I wasn't able to right-click, but I got the image by dragging it off the browser and onto my desktop. I've attached it as proof.

According to my Activities window in my browser, the URL of that image is http://timesofindia.indiatimes.com/photo/5105277.cms You can navigate to that URL to see the image.

yeah thanks, i could do the same thing.
But there might be some way to do these things..?

You can't block those things. This applies to PDFs, images, any object embedded in HTML can be downloaded. Your browser must be able to download it in order to view it. Therefore, you can download it yourself if you use an alternative to the right-click method if that has been disabled by Javascript.

Disclaimer: Streaming content is different because it is not an embedded object. It's a stream of data continuously being transmitted. Streaming content is more difficult to capture, and depending on the format, sometimes impossible.

yes I got it, once i came across with an article talking about blocking or removing the feature from the browsers , ie. making it illegal to have an view source code feature in the browser.
But I am looking forward for development of such things, maybe some framework on top of javascript, which will achieve the protect the copyrights of the contents like pdf, images etc from the website.

mr edwinn

1- i wasnt challenge u at all :)

2- i didn't say that i know a specific web sites can do this i said "i know that asp can do it" based on my asp developers friends , so maybe there are a solution really or they are dreaming i am on my way to make sure.

maybe asp can control this thing coz its after all a Microsoft product and they supply it with the necessary tools to deactivate some properties in any software operating on Windows OS.

but after all am gonna to make sure 100% then i will come with the last conclusion

thanks all for posting , really appreciate it .

foolproof, :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.