Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPrinter: write password protected pdf
Forum Updated to NodeBB v4.3 + New Features

QPrinter: write password protected pdf

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SergioDanielG
    wrote on last edited by
    #1

    Hi all.

    It's posible to write password protected pdf file using QPrinter?
    I can't find anything about that in documentation.
    Thanks in advance.
    Regards.

    www.ftatv.com.ar El foro argentino de la TV libre

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      It is not documented because it is not possible with Qt (neither user nor owner password). You could post-process the file to encrypt it (user password) with reference to the relevant "PDF specification":http://www.adobe.com/devnet/pdf/pdf_reference.html or use a third-party library to generate the PDF in the first place.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SergioDanielG
        wrote on last edited by
        #3

        Thanks ChrisW67.
        I saw some third-party library, but it's not possible encrypt an existing file. It's necessary rewrite all pdf code.
        Thanks again.

        www.ftatv.com.ar El foro argentino de la TV libre

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Yes, you would need to parse the PDF file, encrypt the string objects and content streams using the weak RC4 scheme or AES (or another option) and rewrite the file with the necessary extra dictionary entries describing the encryption/document permissions.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved