0

I'm trying to copy the text from a PDF into Excel. Problem is the PDF is password protected disabling the copy function. The text can easily be copied used Windows XPS viewer, Onenote, and other methods. I need the PDF to stay in PDF format because I have a program that pulls data from the PDF. So my original thought was to open my protected PDF and print it as another PDF to copy the text.

So I tried following the previous asked question here: How to remove security from a PDF file?

And it's posted several times over the internet so I assume it works for others. However, when I remove everything starting with "mark currentfile eexec...cleartomark" save, and distill with Adobe, I receive the error from the Adobe distiller:

%%[ Error: undefined; OffendingCommand:  ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%

I tried to research the error, but the OffendingCommand:  doesn't seem to be a popular one.

The steps I've taken for this process:

  1. Open Password Protected PDF
  2. Choose PDF print driver, check print to file
  3. The .ps file is created. I used Notepad to open and edit the .ps file and remove the "mark currentfile...cleartomark" text.
  4. Save
  5. Double click on file with automatically runs Adobe Distiller and I get the message above.

Any help on what I'm doing wrong? Or other ideas? I'm not at liberty to try a third party software in fully removing the password.

P.S. I had read that Adobe, in trying to print to a file creates a temp file that can sometimes be renamed ".pdf" to make it a PDF. Would this be applicable in this case? Which Temp folder would this be in? I tried searching my computer but could not find a like-sized file/files I did try did not work.

1 Answers1

0

I figured it out. Use Notepad++ and not Notepad. Notepad changes things as I saved the edited .ps which caused problems when trying to use ghostscript.