Summary: | how to use AlwaysEmbed/NeverEmbed | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Bob T. <rdtennent> |
Component: | Documentation | Assignee: | Ralph Giles <ralph.giles> |
Status: | NOTIFIED FIXED | ||
Severity: | minor | ||
Priority: | P2 | ||
Version: | 8.14 | ||
Hardware: | All | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | Proposed replacement for ps2pdf.htm documentation |
Description
Bob T.
2004-03-18 10:39:52 UTC
Always/NeverEmbed are a little special because they take arrays instead of names or boolean values. I don't believe it's possible to set them using -d on the command line. Instead you need to feed ghostscript a postscript string to set these parameters. For example: <</AlwaysEmbed [/Helvetica /Times-Roman]>> setdistillerparams Now for the real bug. You can do this on the command line with the -c option, but the way the ps2pdf wrapper counts options assumes any arguments to any options are not separated by whitespace, and it stupidly complains that you've given it the wrong number of options. Thus the usage message you mentioned getting. So the work around is to either insert the above postscript snippet into the file before you convert it, or to invoke ghostscript manually: gs -dBATCH -dSAFER -DNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf -c '.setpdfwrite <</AlwaysEmbed [/Helvetica /Times-Roman]>> setdistillerparams' -f in.ps (this is all the ps2pdf wrapper does) "Now for the real bug." Thanks for the response but I hope this attitude doesn't mean that fixing the documentation is considered to be unimportant. One can imagine how much time users have wasted struggling to use these options over the years and how much sooner the "real" bug would have been discovered if an attempt had been made to document how the options should be used. No no, we agree the documentation should be improved. The current docs do at least suggest the proper route, but some examples would be very helpful given the artificial limitations of the command options. I was just pointing out the work around while we decided what to do about the issue. To wit: * ps2pdf the script needs to pass -c arguments properly * we need examples in Ps2pdf.htm for how to set the distiller parameters * the -d option needs to be smartened up to accept arrays, dicts and strings We'll do at least the first two in the near term. There's one more easy improvement. Let's interpret characters that immediately follow -c . For instance -c.setpdfwrite . Currently they are ignored. I think the proposed change should be implemented because: (1) it follows the Un*x tradition. (2) it follows other GS options, sich a -f (3) it helps to pass options through the scripts. This fix has been suggested earlier but it was declined. Now we have a real case where the fix can help. Regarding -d option, it reads a PostScript token, and can indeed be used to define arrays and strings. gswin32c -da#(s) -db#{s} -c a == /b load == quit (s) {s} A dictionary is not a PostScript token. So it cannot be created by -d . BTW, the error message for -d is misleading. -dvar=name requires name=null, true, or false Created attachment 1764 [details]
Proposed replacement for ps2pdf.htm documentation
Please find attached my proposed revision for the ps2pdf documentation,
incorporating a warning to users: "note 13", specifying which parameters cannot
be specified on the ps2pdf command line.
Apart from that, I also converted all intended printable < and > symbols to
< and >. (The MonoImageDict parameter default value had been appearing
in my browser as <> instead of <<K -1>>.)
I also deleted the extra blank columns that had been present in the parameter
table.
I also inserted the word "the" before the "-c" command line option.
I (Richard C. Yeh) agree. I have been using the CutePDF Writer with the ps2pdf converter and have been putting options into the "C:\Program Files\Acro Software\CutePDF Writer\PDFWrite.rsp" text file, one per line, and I have found: + The -d and -s options are interchangeable. + Strings must be double-quoted; single quotes cause the CutePDF Writer to fail. + The -c option causes the CutePDF Writer to fail. Please find attached my proposed revision to the ps2pdf.htm documentation, incorporating "note 13", warning users which parameters cannot be specified on the ps2pdf command line. Apart from that, I also converted all intended printable < and > symbols to < and >. (The MonoImageDict parameter default value had been appearing in my browser as <> instead of <<K -1>>.) I also deleted the extra blank columns that had been present in the parameter table. rcy3 @ cornell.edu I've reviewed the suggestions, and added some clarification on the use of the ps2pdf scripts/.bat files w.r.t. the dictionary parameters and the use of the -c option. In paticular, the use of the '@' option file can allow -c options paramters or multiple source files. Although I perfer the gs command line, it does avoid having to remember all of the other options that are embedded in the ps2pdf script (like -dSAFER -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile= -c .setpdfwrite). Note that I did test the use of the @ option on unix and windows and it works OK. It may not work on VMS where the "shell" (I use the term loosely) treats the '@' as a file containing parameters, but I don't have a VMS system to test on (they are getting quite rare). |