-2

there are few stories (text + images) stored in a database (in HTML format). Using PHP I would show them, but I would prevent the exctraction, copy or download from the site.

I used the imagick library with the setImageFormat function:

<?php
    $im = new imagick('file1.pdf[0]');
    $im->setImageFormat('jpg');
    $im->setImageCompressionQuality(100);
    header('Content-Type: image/jpeg');
    echo $im;
?>

but this requires the creation of a PDF first and I'd like to load it directly from the DB and the quality of the image is so poor and is not readable using tablets/smartphones.

Is there a way to allow to read the material and prevent its copy?

I searched in this site, but the few answers are not covering my need.

Thanks in advance!

Carmaox
  • 7
  • 3
  • 1
    A: Don't put it on the Internet. – Funk Forty Niner Aug 15 '17 at 18:22
  • 1
    There is no way to do what you want. If you're sending it to a browser, it can be captured and stolen - they can use web developer tools, take a screenshot, etc. Simple as that. – ceejayoz Aug 15 '17 at 18:26
  • This seems a duplicate of [Restrict file access — only read through PHP](https://stackoverflow.com/questions/3472770/restrict-file-access-only-read-through-php) or [What are some good ways of keeping content from being copied to other sites](https://stackoverflow.com/q/1380315/1415724) or [Allow contents to be copied of pdf created using tcpdf](https://stackoverflow.com/q/18613788/1415724) – Funk Forty Niner Aug 15 '17 at 18:28
  • I suppose you could convert all images to white boxes -- uses white font on a white background and then rasterize the entire PDF .. Ha, take that thieves! – Zak Aug 15 '17 at 18:36

1 Answers1

1

No. If you put it on the internet, and it's publicly available, you cannot stop people from copying the content. A pdf will not stop anyone from copying your images either. No matter what you do, there is a workaround.

catbadger
  • 1,662
  • 2
  • 18
  • 27