cyberlabs.us | home | subscribe | contact | admin
Monday, July 7th  
Removing PDF Document Security with Ubuntu
Informational

# apt-get install pdftk

# pdftk original.pdf output cleaned.pdf allow AllFeatures

It will give you a warning, but cleans the file just fine.

WARNING: The creator of the input PDF:
   original.pdf
   has set an owner password (which is not required to handle this PDF).
   You did not supply this password. Please respect any copyright.


SYNOPSIS
       pdftk < input PDF files | - | PROMPT >
            [ input_pw < input PDF owner passwords | PROMPT > ]
            [ < operation > < operation arguments > ]
            [ output < output filename | - | PROMPT > ]
            [ encrypt_40bit | encrypt_128bit ]
            [ allow ]
            [ owner_pw < owner password | PROMPT > ]
            [ user_pw < user password | PROMPT > ]
            [ flatten ] [ need_appearances ]
            [ compress | uncompress ]
            [ keep_first_id | keep_final_id ] [ drop_xfa ] [ drop_xmp ]
            [ verbose ] [ dont_ask | do_ask ]
       Where:
            < operation > may be empty, or:
            [ cat | shuffle | burst | rotate |
              generate_fdf | fill_form |
              background | multibackground |
              stamp | multistamp |
              dump_data | dump_data_utf8 |
              dump_data_fields | dump_data_fields_utf8 |
              dump_data_annots |
              update_info | update_info_utf8 |
              attach_files | unpack_files ]

Another alternative, qpdf.

# apt-get install qpdf

# qpdf --decrypt restricted-input.pdf unrestricted-output.pdf


Basic Options
-------------

--version               show version of qpdf
--copyright             show qpdf's copyright and license information
--help                  show command-line argument help
--password=password     specify a password for accessing encrypted files
--verbose               provide additional informational output
--linearize             generated a linearized (web optimized) file
--copy-encryption=file  copy encryption parameters from specified file
--encryption-file-password=password
                        password used to open the file from which encryption
                        parameters are being copied
--encrypt options --    generate an encrypted file
--decrypt               remove any encryption on the file
--password-is-hex-key   treat primary password option as a hex-encoded key
--pages options --      select specific pages from one or more files
--rotate=[+|-]angle:page-range
                        rotate each specified page 90, 180, or 270 degrees
--split-pages=[n]       write each output page to a separate file




January 25th, 2021 - 03:19 pm | read more | comments