Locked PDFs


Some PDF files are locked so that printing or editing is disallowed: see list of pages with locked files. But if the file is in the public domain, you can remove that restraint. This page is dedicated to people sharing different ways of unlocking locked PDF files.

Contents

Methods

1: Using PDF Split and Merge

You can use this program to split and merge PDF files, but you can also use it to unlock locked PDF files. This method is lossless (i.e. no quality lost). In addition, lossless recompression is done in some cases, with the resulting PDF file being smaller than the source PDF file. (Note: Versions 1.0 and newer of PDFSAM actually obey PDF restrictions, so you will need an older version than that.)

How to download

  • Main page - General information on the project, as well as site entry point.
  • Download page - List of relevent files for download.
    • Windows users: Use the installer provided (file name is pdfsam-win32inst-v0_6_sr3.exe as of version 0.6sr3).
    • OS X and *nix users: Use the universal Java package (file name is pdfsam-0.6sr3-out.zip as of version 0.6sr3). Unzip the file, and double click on pdfsam-0.6sr3.jar, or, if that doesn't work, run java -jar /path/to/pdfsam-0.6sr3.jar from a console.
  • Prerequisites

How to use for unlocking

You can simply use the merge tool to merge one single PDF file, and the output file should be unlocked.

2: Using Ghostscript and Gsview

How to download

Ghostscript and Gsview download pages. Register or don't register Gsview. Ghostscript is the prerequisite of Gsview.

How to use for unlocking

Open the file with Gsview. Convert, Device=pdfwrite, Resolution=that of the locked file. A higher resolution will provide a bigger file.

3: Converting to PostScript and back to pdf

Prerequisite:

  1. On Windows: MiKTeX distribution
  2. On Linux: pdf2ps and ps2pdf are already present.

Type:

  1. pdf2ps yourpdffile.pdf tempo.ps
  2. ps2pdf tempo.ps newpdffile.pdf

Delete the huge tempo.ps file when done.

4: Using QPDF

Run the following command:

  1. qpdf --decrypt --password="" input.pdf output.pdf

5: Editing the PostScript format

Some pdf's cannot be converted to PostScript with pdf2ps or gsview and some PostScript files cannot be converted - distilled - to pdf. See source.

  1. Find the driver of a printer containing PostScript or PS in its name and install it on your computer if you have none (but don't purchase this printer).
  2. Open the pdf file and print it with this printer, selecting Print into a file. Name this file something.ps. If your pdf viewer has forced the .prn extension rename the file to .ps. Edit it with your usual text editor.
  3. Search lines containing this:
    % Removing the following <about ten> lines is illegal, subject to the Digital Copyright Act of 1998.
    Next to them are:
    1. blocks with:
      mark currentfile eexec
      <about 10 lines of junk>
      cleartomark
      Delete them.
    2. blocks with:
      currentfile eexec
      <about 10 lines of junk>
      exec
      Replace currentfile eexec <junk> in each one with:
      PDFVars begin PDF begin PDFVars/InitAll get
      leaving the exec line.
  4. Convert the ps file to pdf with ps2pdf or gsview.

6: Using pdfimages

If the pdf is a scan, type pdfimages -j yourpdfscore.pdf p . This will produce pages p-001.jpg, p-002.jpg etc. Convert them to pdf with your usual method or read How to make PDF files in Talk: Scanning music scores

Submission back to IMSLP

Please upload the file back to IMSLP if possible.

If the unlocking process you went through is lossless and without a large increase in file size, you can upload directly to the same file name, and replace it. Otherwise, please upload it as a separate file (maybe adding "(unlocked)" or "(fixed)" to the file name), and submit it to the same work page as the original file, with a note in the Misc. Notes section of the entry.

Also, if you uploaded the file to the same file name as the original, there may be up to 24 hours delay before the new version of the file will appear on the IMSLP image server, so do not panic if you find the old version of the file still being offered for download right after you uploaded it; wait at least 24 hours before you test it.