Bug 700930 - Typo in example command for PDF/X-3 in VectorDevices.htm
Summary: Typo in example command for PDF/X-3 in VectorDevices.htm
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 9.26
Hardware: PC Windows 10
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-31 19:27 UTC by i3v
Modified: 2019-04-02 23:38 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description i3v 2019-03-31 19:27:19 UTC
The doc file https://www.ghostscript.com/doc/9.26/VectorDevices.htm#PDFX contains the following example command:

> gs -dPDFX -dBATCH -dNOPAUSE -sColorConverionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps

For me, it does not actually work with the "PDFX_def.ps" that is provided with gs http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=lib/PDFX_def.ps;h=4c34d06de08a33fa7afd734feb833944e968c4ff;hb=8efbedbab72687cb51e3c353d5665d00120eed4a :

> ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.
> Error: /rangecheck in ProcessColorModel

It works OK with explicit `-sColorConverionStrategy=CMYK`:

> gswin64c -dPDFX -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sColorConverionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3_fixed.pdf PDFX_def.ps alphabet.ps 

PS
* I use alphabet.ps from gs source:  http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=examples/alphabet.ps;h=33069fe5f264cd9c3c416866c92ef683a88e94fd;hb=8efbedbab72687cb51e3c353d5665d00120eed4a .
* Default "PDFX_def.ps" also requires "ISO Coated sb.icc".


PPS
I think there's also a typo in "PDFX_def.ps": there should be either 2 or 0 "/" in
> ERROR: ProcessColorModel must be /DeviceGray or DeviceCMYK.
Comment 1 i3v 2019-03-31 19:36:21 UTC
(In reply to i3v from comment #0)
> It works OK with explicit `-sColorConverionStrategy=CMYK`:

There's a typo, sorry.
I mean "It works OK with explicit `-sProcessColorModel=DeviceCMYK`:"
Comment 2 Ken Sharp 2019-04-01 06:57:38 UTC
(In reply to i3v from comment #0)

> > gs -dPDFX -dBATCH -dNOPAUSE -sColorConverionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps
> 
> For me, it does not actually work with the "PDFX_def.ps" that is provided
> with gs

> It works OK with explicit `-sColorConverionStrategy=CMYK`:
> 
> > gswin64c -dPDFX -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sColorConverionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3_fixed.pdf PDFX_def.ps alphabet.ps 

Your report is unclear here, you appear to be saying it doesn't work with the incorrectly spelled -sColorConverionStrategy and then saying that it *does* work correctly with the incorrectly spelled ColorConverionStrategy.

I think you mean it works correctly with an explicit -sProcessColorModel=CMYK, which is harldy surprising since that key is what the PDFX_def.ps is testing. If you spell the ColorConversionStrategy incorrectly then it won't (obviously) have any effect and won't automatically set the ProcessColorModel for you.


> * Default "PDFX_def.ps" also requires "ISO Coated sb.icc".

No, it requires you to *edit* the file if you want to use something else. The file even contains a comment to that effect beside the usage:

/ICCProfile (ISO Coated sb.icc) def  % Customize or remove.

The various *_def.ps files are examples and they all require editing before use.
Comment 3 i3v 2019-04-01 19:24:19 UTC
(In reply to Ken Sharp from comment #2)

Thanks for the fixes in http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=f5bd9757cffeb8b173cdde161b39abd381e325c3 !


1) But the new command 
> gs -dPDFX -dBATCH -dNOPAUSE -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps
   still does not work (with gs version 9.26) - it only works if I add 
   `-sProcessColorModel=DeviceCMYK`. Do you mean it works with the "master"
  version?

2) there's a new tiny typo, "versionM" in "new color conversion code in 
   versionm 9.11", see http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=doc/VectorDevices.htm;h=212b0b7017b728935c34aa04ddc1e47c153a92af;hb=HEAD#l466
Comment 4 Ken Sharp 2019-04-02 07:19:07 UTC
(In reply to i3v from comment #3)
> (In reply to Ken Sharp from comment #2)
> 
> Thanks for the fixes in
> http://git.ghostscript.com/?p=ghostpdl.git;a=commit;
> h=f5bd9757cffeb8b173cdde161b39abd381e325c3 !
> 
> 
> 1) But the new command 
> > gs -dPDFX -dBATCH -dNOPAUSE -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps
>    still does not work (with gs version 9.26) - it only works if I add 
>    `-sProcessColorModel=DeviceCMYK`. Do you mean it works with the "master"
>   version?

Your report says there is a typo in the command, which I fixed. Your comment #0 uses 'ColorConverionStrategy' (ie missing an s) in both command lines. So no, I didn't test with ColorConversionStrategy, because the report here doesn't say that there's a problem with that.

If there's an actual bug (as opposed to a typo in the documentation) then that would be a different bug report.

> 2) there's a new tiny typo, "versionM" in "new color conversion code in 
>    versionm 9.11", see
> http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=doc/VectorDevices.htm;
> h=212b0b7017b728935c34aa04ddc1e47c153a92af;hb=HEAD#l466

Please don't add to a closed bug report. Clsoed reports don't show up on our tracking so if yo udo this, they *will* get lost.
Comment 5 Ken Sharp 2019-04-02 09:59:29 UTC
OK so I *believe* that this commit 2c97be9f328babb7b544ab3610e6fce05e30cdc8
will mean that you don't have to specify ProcessColorModel on the command line (it wasn't being used anyway). It also spruces up both this and the pdfa_def.ps file a bit, partly to make it clearer that you are *supposed* to modify these files.

This commit 978b03b453245c2a48abaee5addea3b7e025a2ed fixes the typo.

To avoid confusion, please don't put more than one problem in a bug report. If you find a typo in the documentation *and* a real bug, do please open two reports, otherwise I'm afraid I just get confused.
Comment 6 i3v 2019-04-02 23:38:03 UTC
(In reply to Ken Sharp from comment #4) 
> Your report says there is a typo in the command, which I fixed.
I admit my original error message was quite messy, sorry.

Just for the reference, here's another follow-up: https://bugs.ghostscript.com/show_bug.cgi?id=700942 .