Error /undefinedfilename In Gs
Contents |
here for a quick overview of the site Help Center Detailed answers to any ghostscript error /undefined in questions you might have Meta Discuss the workings and policies
Ps2pdf Undefinedfilename
of this site About Us Learn more about Stack Overflow the company Business Learn more about ghostscript command line hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Ghostscript: “Unrecoverable error: undefinedfilename in setpagedevice” up vote 1 down vote favorite I'm trying to compress pdf files using ghostscript like this: gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sOutputfile=output.pdf input.pdf I've done this successfully in the past, but for some reason now it won't work. I get the following error: GPL Ghostscript 9.15 (2014-09-22) Copyright (C) 2014 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. **** Unable to open the initial device, quitting. Unrecoverable error: undefinedfilename in setpagedevice Operand stack: true --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- [Edit: I fixed the typo from -SOutputFile to -sOutputFile to avoid this red herring. (But that is what some of the comments/answers are referring to.)] pdf ghostscript share|improve this question edited Dec 13 '14 at 16:25 asked Dec 13 '14 at 0:48 emacsomancer 294314 1 -SOutputFile is incorrect, it should be -sOutputFile. Because you haven't specified an output file, you get an undefinedfilename. Not too surprising :-) I strongly recommend that you don't use -dPDFSETTINGS but instead set the switches you want individually. –KenS
in your last search results. Bug695184 - Error: /undefinedfilename Summary: Error: /undefinedfilename Status: RESOLVED WORKSFORME Product: Ghostscript Classification: Unclassified Component: PDF Interpreter Version: 9.14 Hardware: PC Windows 7 Importance: P4 normal Assigned To: Ken Sharp QA Contact: Bug traffic URL: Keywords: Depends on: Blocks: Show dependency tree /graph Reported: 2014-04-24 02:07 PDT by Harry McKame Modified: 2014-04-24 07:18 PDT (History) CC List: 1 user (show) chris.liddell See Also: Customer: Word Size: --- Attachments PDF file with problem (4.26 MB, application/pdf) 2014-04-24 02:07 PDT, Harry McKame http://stackoverflow.com/questions/27454350/ghostscript-unrecoverable-error-undefinedfilename-in-setpagedevice Details screen capture of error message (40.52 KB, image/jpeg) 2014-04-24 02:08 PDT, Harry McKame Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Harry McKame 2014-04-24 02:07:37 PDT Created attachment 10849 [details] PDF file with problem The attached PDF file file works fine without parameters by http://bugs.ghostscript.com/show_bug.cgi?id=695184 causes "Error: /undefinedfilename" when run with the following parameters : "C:\Program Files (x86)\gs\gs9.14\bin\gswin32.exe" "-IC:\Program Files (x86)\gs\gs9.14\lib;C:\Program Files (x86)\gs\gs9.14\fonts" -dNOPAUSE -dBATCH -dSAFER -sDEVICE=jpeg -dEPSCrop -f -q -dTextAlphaBits=4 -dUseCropBox -dDOINTERPOLATE -sOutputFile="%%d.jpg" "Michelin_Dossier de Presse_Commémorations Guerre 14-18.pdf" PDF file and screen capture are attached. Comment 1 Harry McKame 2014-04-24 02:08:21 PDT Created attachment 10850 [details] screen capture of error message Comment 2 Ken Sharp 2014-04-24 04:26:35 PDT It would help a lot if you could try cutting down the parameters to just those which cause a problem. You have specified -dEPSCrop and -dUseCropBox, which doesn't make sense. EPSCrop isn't going to have any effect with a PDF input file, and you shouldn't try to specify multiple crops anyway. You have specified two '%' characters in the -sOutputFile, this will escape the second '%' and cause the output to be written to a single file called '%d.jpg' which almost certainly isn't what you want. You have specified -f without a preceding -c so it has no effect. You don't need to supply these parameters : "-IC:\Program Files (x86)\gs\gs9.14\lib;C:\Program Files (x86)\gs\gs9.14\fonts" as these are already built-in to the GS executable. If you do decide to include th
to you by: cliddell, marcosw, milesjones, rayjj Summary Files Reviews Support Wiki Tickets ▾ Feature Requests Support Requests Patches News Discussion Code Create Topic https://sourceforge.net/p/ghostscript/discussion/5451/thread/6ca11900/ Stats Graph Forums Help 744 Open Discussion 185 Help Formatting http://superuser.com/questions/456077/how-to-avoid-undefinedfilename-error-when-piping-a2ps-output-to-ps2pdf Help "undefinedfilename" error wi... Forum: Open Discussion Creator: Anonymous Created: 2011-04-26 Updated: 2013-03-21 Anonymous - 2011-04-26 Hi to everybody. I'm an italian boy who like visual basic .net development and I speak/write english not very well, so I hope you forgive me for this error /undefined "problem". I'm developing an application that check how many pages are written in a PDF document using the gsdll64.dll library (version 9.02 but I found the same problem just with the 8.70 version). When i execute this command using API: -o nul -sDEVICE=nullpage "C:\New_folder\01 test.pdf" or -dBATCH -dNOPAUSE -sDEVICE=nullpage "C:\New_folder\01 test.pdf" or -o nul -sDEVICE=nullpage error /undefinedfilename in "C:/New_folder/01 test.pdf" or -dBATCH -dNOPAUSE -sDEVICE=nullpage "C:/New_folder/01 test.pdf" … I obtain the following output: ------- START: OUTPUT FROM GSDLL64.DLL ------- GPL Ghostscript 9.02 (2011-03-30) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Error: /undefinedfilename in ("C:\\New_folder\\01) Operand stack: Execution stack: %interp_exit .runexec2 -nostringval- -nostringval- -nostringval- 2 %stopped_push -nostringval- -nostringval- -nostringval- false 1 %stopped_push Dictionary stack: -dict:1154/1684(ro)(G)- -dict:0/20(G)- -dict:77/200(L)- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.02: Unrecoverable error, exit code 1 ------- END: OUTPUT FROM GSDLL64.DLL ------- I can't understand if I send an incorrect "script". I cannot find nothing about escape chars to use in string path with whitespaces. Thanks in advance for any suggestion. If you would like to refer to this comment somewhere else in this project, copy and paste the following link: SourceForge About Site Status @sfnet_ops Powered by Apache Allura™ Find and D
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top how to avoid undefinedfilename error when piping a2ps output to ps2pdf up vote 2 down vote favorite I am trying to write a bash function to convert a text file to PDF using a combination of a2ps and ps2pdf. To convert exc.cpp I have the following command: a2ps -M a4 -B -1 -o - exc.cpp | ps2pdf -sPAPERSIZE=a4 -o exc.pdf - But I get an error indicating undefined filename the following error output: GPL Ghostscript 9.04 (2011-08-05) Copyright (C) 2011 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. [exc.cpp (C++): 2 pages on 2 sheets] [Total: 2 pages on 2 sheets] sent to the standard output Error: /undefinedfilename in (.setpdfwrite) Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:1160/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript 9.04: Unrecoverable error, exit code 1 Is there some way to specify to ps2pdf a value for the filename to avoid this error? Or is there a simpler way to convert a text file to PDF? linux pdf share|improve this question asked Aug 1 '12 at 1:28 Bowie Owens 1134 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted a2ps and ps2pdf do not share the same syntax. According to UNIX man pages : ps2pdf (1), the basic syntax of ps2pdf is ps2pdf [options...] {input.[e]ps|-} [output.pdf|-] This will work: a2ps -M a4 -B -1 -o - exc.cpp | ps2pdf -sPAPERSIZE=a4 - exc.pdf share|improve this answer answered Aug 1 '12 at 1:51 Dennis 34.1k573117 Thanks, that has fixed it nicely. –Bowie Owens Aug 1 '12 at 2:08 add a comment| You must log in to answer this question. Not the answer you're looking for? Browse other questions tagged linux pdf . asked 4 years ago viewed 1488 times ac