Menu

Flatten PDF

Help
Mark
2014-03-15
2014-03-23
  • Mark

    Mark - 2014-03-15

    Hi,

    I'd like to know if anyone knows of a way to flatten the pdf during creation so that textand images can not be copied out. I am creating the PDF from html.

    Thanks

     
    • epistaxis

      epistaxis - 2014-03-15

      On Sat, 15 Mar 2014 13:15:29 +0000
      "Mark" liormark@users.sf.net wrote:

      I'd like to know if anyone knows of a way to flatten the pdf
      during creation so that textand images can not be copied out. I am
      creating the PDF from html.

      I think the only way to do so is to forbid all modifications
      and encrypt the PDF with a null p/w for the user and a large
      one for the owner - this way, users can open the PDF without
      any problem but can't do anything forbidden.

      If you're under Linux, I do that with qpdf (takes 0.2s to do
      that).

      Be aware that this "protection" will only last against rookies,
      not against experienced people.

      --

       
      • Olipla

        Olipla - 2014-03-23

        Be aware that this "protection" will only last against rookies

        Nope. Firefox's built-in viewer ignores protection settings, so many users, including rookies, won't even notice that your PDF is protected.

         
  • Mark

    Mark - 2014-03-17

    I looked at qpdf but it's looks like it only has command line structure. Is it possible to use it from PHP like tcpdf?

    Also, to clarify what I'm trying to do. Say you put a document and and image on a scanner and scan it, it becomes one scanned image which you can then turn into a pdf file, they become insperable, that's what I'm looking for.

     
    • epistaxis

      epistaxis - 2014-03-17

      On Mon, 17 Mar 2014 20:55:55 +0000
      "Mark" liormark@users.sf.net wrote:

      I looked at qpdf but it's looks like it only has command line
      structure. Is it possible to use it from PHP like tcpdf?

      http://fr2.php.net/function.exec
      But you can achieve that with TCPDF intrinsic features (I use
      qpdf because it is hell fast and because I apply some ghostscript
      very long processes (compression and image reduction) before doing
      that).

      Also, to clarify what I'm trying to do. Say you put a document and
      and image on a scanner and scan it, it becomes one scanned image
      which you can then turn into a pdf file, they become insperable,
      that's what I'm looking for.

      The way I understand it (making a PDF and apply some magic to
      get the result you describe), it is impossible.

      The only way to achieve that is the one you describe: scan and
      transform into a PDF (which, in turn, can lead to an image that
      can be extract from the PDF and skillfully modified, then eventually
      re-transformed into a new forged PDF).

      So, if you're looking for a way to insure the PDF integrity,
      use a checksum next to it (SHA512 is quite a good candidate).

      --
      Manon: Hi, it's the girl you met this morning :)
      Alex: Which one?

       

Log in to post a comment.