Error /undefinedfilename In Sdevice=pdfwrite
Contents |
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 ghostscript error /undefined in Learn more about Stack Overflow the company Business Learn more about hiring developers or
Ps2pdf Undefinedfilename
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Ghostscript Command Line
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 up vote 0 down vote favorite 2 PROBLEM On many sites are trying to explain it, but error message is pretty unclear. In my case I had a lot of pdf files to merge and for some reason one file was big problem. Ghostscript unrecoverable error undefinedfilename syntax-error ghostscript solution share|improve this question edited Mar 26 '15 at 11:38 asked Aug 24 '13 at 0:00 Bruno Garett 1,83321626 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote I received the same error by neglecting the dash before dBATCH. So gs dBATCH ... instead of gs -dBATCH ... share|improve this answer answered Aug 27 '14 at 21:09 Reid Evans 531513 super thank you –Bruno Garett Sep 2 '14 at 0:38 add a comment| up vote 1 down vote accepted SOLUTION If you got this message then merge files with asterix gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dQUIET -dSAFER -sOutputFile=out.pdf *.pdf If out.pdf is OK It means "your file path or file does not exist". Now is the message "undefinedfilename" already clear. share|improve this answer edited Mar 26 '15 at 11:39 answered Aug 24 '13 at 0:00 Bruno Garett 1,83321626 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged syntax-error ghostscript solution or ask your own question. asked 3 years ago viewed
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 Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 http://stackoverflow.com/questions/18413542/ghostscript-unrecoverable-error-undefinedfilename Why does this gs command fail on --filename.pdf? up vote 0 down vote favorite System: Ubuntu 16.04 64 bit. Code from here gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=newfile.pdf badfile.pdf Outputs: Usage: gs ... -- file.ps arg1 ... argn The expected output: a new .pdf file. 2nd version gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=newfile.ps badfile.pdf Same output as above. Larsks. I get GPL Ghostscript editor by running gs. Command type -a gs gives gs is /usr/bin/gs. Command http://unix.stackexchange.com/questions/280820/why-does-this-gs-command-fail-on-filename-pdf/280850 dpkg-query -s ghostscript | grep Version gives Version: 9.18~dfsg~0-0ubuntu2. So gs is ghostscript in my system. Why does the gs command fail? pdf share|improve this question edited May 5 at 9:18 asked May 3 at 14:12 Masi 1,09231030 Is gs complaining because you're passing it a .pdf file instead of a .ps file? –Jeff Schaller May 3 at 14:17 That doesn't look like a "normal" GPL Ghostscript usage message - do you have some other gs installed (Aladin / AFPL maybe?) –steeldriver May 3 at 14:35 1 based only on flimsy archive evidence, does 'gs' want to see an actual '--' before 'badfile.pdf'? –Jeff Schaller May 3 at 17:24 1 From looking at the code, the error message is due to giving gs a -- argument, i.e. something that looks like a long option without an actual option name. Is gs an alias, function, or wrapper script? Is badfile.pdf the actual argument, or is there a -- in its name? –Mark Plotnick May 3 at 19:19 2 @Masi so the issue would have been much easier to identify if you had not obfuscated the actual filenames –steeldriver May 3 at 19:57 | show 3 more comments 2 Answers 2 active oldest votes up vote 3 down vote accepted gs is complaining about file arguments such as ---plaa---plaa.pdf because t
--file-- ) Messages sorted by: [ date ] [ thread ] [ subject ] http://ghostscript.com/pipermail/gs-devel/2010-June/008781.html [ author ] Thanks, Unfortunately, I don't understand something. http://www.linuxjournal.com/content/tech-tip-using-ghostscript-convert-and-combine-files I found a RGB ICC profile and filled out the lines in PDFA_def.ps. If I use: -------------------- $gs -q -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=out-a.pdf PDFA_def.ps file.pdf -------------------- There isn't any problem to build the file, but error /undefined I want to build independent color PDF/A files (-dUseCIEColor), so I guess I don't need the -sProcessorColorModel switch, but I encounter this issue: -------------------- $gs -q -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=out-a.pdf PDFA_def.ps file.pdf Unrecoverable error: rangecheck in .putdeviceprops -------------------- Is -sProcessorColorModel switch mandatory ? If yes, why error /undefinedfilename in should I use it to build an independent color PDF/A files ? Regards, Vianney Le 30 juin 2010 à 16:41, Ken Sharp a écrit : > At 15:57 30/06/2010 +0200, Vianney Lejeune wrote: > > >> Did I forget something to make ghostscript builds the file ? > > You need to modify the content of the pdfa_def.ps file, in particular you *must* edit the /ICCProfile to point to the a valid ICC profile somewhere on your system. > > You have left it set to (ISO Coated sb.icc), GS is unable to find the named file in the current directory, hence the undefinedfilename error. > > > Ken > Previous message: [gs-devel] Problem using gs to build a PDF/A (Error: /undefinedfilename in --file-- ) Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] More information about the gs-devel mailing list
line. It is easy to combine several input files into one combined PDF using Ghostscript: gs -sDEVICE=pdfwrite \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.pdf \ first.pdf \ second.pdf \ third.pdf [...] Your input files don't even need to be PDF files. You can also use PostScript or EPS files, or any mixture of the three: gs -sDEVICE=pdfwrite \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.pdf \ first.pdf \ second.ps \ third.eps [...] The combined.pdf file will contain the input files in the order given on the commandline. If you don't want the combined file to be PDF, but PostScript instead, you may want to use this: gs -sDEVICE=pswrite \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.ps \ first.pdf \ second.ps \ third.eps [...] Should you for whatever reason want PostScript level 1 output, add a language level parameter: gs -sDEVICE=pswrite \ -dLanguageLevel=1 \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.ps \ first.pdf \ second.ps \ third.eps [...] The default PostScript language output level is 2. Using "1.5" is also supported, which is language level 1 with color extensions. You can convert color input files into black/white or non-color/gray PostScript like this: gs -sDEVICE=psgray \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.ps \ first.pdf \ second.ps \ third.eps [...] gs -sDEVICE=psmono \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=combined.ps \ first.pdf \ second.ps \ third.eps [...] Should you for some reason need a series of single-page EPS files made up of pages from various input files, try this: gs -sDEVICE=epswrite \ -dNOPAUSE -dBATCH -dSAFER \ -sOutputFile=p%08d.eps \ 5page-first.pdf \ 7page-second.ps \ 1page-third.eps [...] The resulting files will be nicely named as p00000001.eps .... p00000013.eps ... But be aware, converting PDFs back to PostScript (or EPS), like the last 6 commands did, may loose some or much of the original quality. For example, PostScript can't handle t