2

I want to convert my .ps file (which was created from an encrypted .pdf file) back to a .pdf format.

Using ps2pdf in ghostscript gives me the following message on my command prompt:

This PostScript file was created from an encrypted PDF file.
Redistilling encrypted PDF is not permitted. 
Error: /undefined in
--eexec-- Operand stack:    --nostringval--   --dict:89/200(L)--   quit Execution stack:    %interp_exit   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1977   1   3   %oparray_pop   1976   1   3  
%oparray_pop   1960   1   3   %oparray_pop   1852   1   3  
%oparray_pop   --nostringval--   %errorexec_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   1843   2   3   %oparray_pop  
--nostringval--   --nostringval--   --nostringval-- Dictionary stack:    --dict:1198/1684(ro)(G)--   --dict:1/20(G)--   --dict:89/200(L)--   --dict:1198/1684(ro)(G)-- 
Current allocation mode is local Last OS error: No such file or directory 

GPL Ghostscript 9.18: Unrecoverable
error, exit code 1

Is there anyway to convert my .ps file back to .pdf if I know the password of the original encrypted .pdf file from which the .ps file was created?

  • Have you tried passing the password on the ps2pdf commandline using the -sOwnerPassword=xxxxx option? – steeldriver Dec 31 '17 at 12:45
  • @steeldriver I tried using it, gives the same message as mentioned in the question. – Kewal Shah Dec 31 '17 at 18:00
  • Do you still have the original (encrypted) PDF document? I would restart with that and decrypt it in the process of conversion to PS. Then you shouldn't need to deal with encryption during the reconversion to PDF. – David Foerster Dec 31 '17 at 19:19
  • @DavidFoerster Yes I have the original PDF document but the problem is, I do not know how to do that! – Kewal Shah Jan 1 '18 at 4:02
  • 1
    For manual use replace the shell variables $INPUT, $OUTPUT, and $PASSWORD in the gs invocation in the last 5 lines with the respective strings. Examples are in the first 3 lines. Alternatively, save the file, edit the first 3 lines to your liking and execute the script. – David Foerster Jan 1 '18 at 12:06
1

Why don't you use imagemagick? Try this:

convert myfile.ps myfile.pdf

Hope it helps you

  • While imagemagick does convert it to a .pdf format sucessfully, the images in the converted pdf are highly blurred, so it's not of any use to me. Thanks for the suggestion anyway. – Kewal Shah Dec 31 '17 at 18:06
  • So I think better you use photoshop?? by Wine. Sorry. – Tim Dec 31 '17 at 18:13
  • 1
    Adding -density 300 fixed the blurriness issue for me. – Hypercube Nov 29 '18 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.