Find the answer to your Linux question:
Results 1 to 3 of 3
Hi folks, I have some technical documents on .pdf format download from Internet. They are allowed to download by filling personal information. I supposed they have been encrypted. Each time ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787

    encrypted .pdf files


    Hi folks,

    I have some technical documents on .pdf format download from Internet. They are allowed to download by filling personal information. I supposed they have been encrypted.

    Each time I have to re-filling in the same personal data before I can read the document. It is not convenient. Besides their contents can't be copied/pasted. Each time trying to highlight their text warning popup saying this operation not permitted.

    I succeeded printing them as .ps files. However still I could not copy/paste their content. Running

    # ps2pdf tmp_001.ps tmp_001.pdf
    Code:
    This PostScript file was created from an encrypted PDF file.
    Redistilling encrypted PDF is not permitted.
    Error: /undefined in --get--
    Operand stack:
       --nostringval--   --dict:88/200(L)--   quit
    Execution stack:
       %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3 %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   2   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
    Dictionary stack:
       --dict:1063/1123(ro)(G)--   --dict:0/20(G)--   --dict:88/200(L)--   --dict:1063/1123(ro)(G)--
    Current allocation mode is local
    GNU Ghostscript 7.07: Unrecoverable error, exit code 1
    I can open the .ps file with GIMP but could not re-save it as .pdf becuase .pdf format is not available on GIMP for saving.

    Kindly advise is there a way to decrypt the .pdf file not having to filling same personal data to read it.

    TIA

    BR
    satimis

  2. #2
    Just Joined!
    Join Date
    Feb 2007
    Location
    Columbus, OH
    Posts
    2

    Thumbs up

    Quote Originally Posted by satimis
    Each time I have to re-filling in the same personal data before I can read the document. It is not convenient.

    # ps2pdf tmp_001.ps tmp_001.pdf
    Code:
    This PostScript file was created from an encrypted PDF file.
    Redistilling encrypted PDF is not permitted.
    Kindly advise is there a way to decrypt the .pdf file not having to filling same personal data to read it.
    The problem is not in the .pdf files, but in the postscript generated by the Acrobat reader. The fix is simple: ghostscript should not let the acrobat-generated postscript know that it's writing a .pdf file.

    Here's how:

    Look into /usr/share/ghostscript/*/lib/gs_pdfwr.ps. You'll need to edit this file as root.

    Close to end of the file, there will be following lines:
    Code:
    % Patch 'where' so that the distiller operators are only visible
    % if the pdfwrite device is the current one.
    { currentdevice .devicename /pdfwrite eq {
        .where
    All you have to do is replace /pdfwrite with something else, like
    Code:
    { currentdevice .devicename /pdfwritexyz eq {
    I've used this method on various downloadable tax forms which are braindead enough not to allow saving with filled-in results. Some better forms (e.g. US federal forms) allow this as they have document rights assigned, but most do not

    Cheers!

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    1

    Lightbulb Update

    First, thank you SO MUCH for your help kuba, that's been a huge issue. I have Adobe Acrobat and needed a way to delete pages, redistill them so the files would be smaller, and make comments permanent (so they print regardless of the print settings), so I figured FreePDFXP, which I run on another computer, would get around this, but it obviously doesn't. I tried printing the file to a Microsoft XPS Document Writer which worked, but that's a hassle, and if I left it as an XPS, most people can't get XPS files to open, if they even have the software. One more awesome program from Microsoft

    I tried your suggestion but instead of adding letters to the end of /pdfwrite, I had to add them in the middle, /pdfXYZwrite, because Ghostscript seemed to ignore the fact that it had extra letters on the end and still gave me the encryption error. Maybe this is a newer version or something, I just downloaded it today.

    Thanks again!

    Diana
    Last edited by wellsmall; 08-20-2008 at 08:30 PM. Reason: wrong user "thanked"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •