Bug 707653 - -dFastWebView=true does not work anymore
Summary: -dFastWebView=true does not work anymore
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 10.03.0
Hardware: PC Windows 11
: P2 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 20:38 UTC by Adrian Devries
Modified: 2024-05-22 07:07 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF files generated from "examples/*.ps" along with log files from gsc and qpdf (4.16 MB, application/x-zip-compressed)
2024-03-11 20:38 UTC, Adrian Devries
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Devries 2024-03-11 20:38:52 UTC
Created attachment 25455 [details]
PDF files generated from "examples/*.ps" along with log files from gsc and qpdf

In Ghostscript 10.03.0 the parameter -dFastWebView=true does not work anymore. The parameter is working in Ghostscript 10.02.1.

Find PDF files generated from "examples/*.ps" along with log files from gsc and qpdf attached.

The same parameters have been used for both versions 10.02.1 and 10.03.0. Consult the log files for details. 

With Ghostscript 10.02.1, gsc and qpdf do not report any issues.

With Ghostscript 10.03.0, for certain PS files gsc does report issues whilst generating PDF files from them, and for PDF files generated from some other PS files qpdf does report issues.

In addition, it seems that the w64 version shows more issues than the w32 version.

gs return codes: rc=0 => no error; rc<0 => error
qpdf return codes: rc=0 => no error; rc=2 => error; rc=3 => warning

|Example              | gs10021w32 | gs10021w32 | gs10021w64 | gs10021w64 | gs10030w32 | gs10030w32 | gs10030w64 | gs10030w64 |
|                     | gs         | qpdf       | gs         | qpdf       | gs         | qpdf       | gs         | qpdf       |
|---------------------|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|
|alphabet             |           0|           3|           0|           3|           0|           2|           0|           2|
|colorcir             |           0|           3|           0|           3|           0|           2|           0|           2|
|doretree             |           0|           3|           0|           3|           0|           2|         -12|           0|
|escher               |           0|           3|           0|           3|           0|           2|           0|           2|
|grayalph             |           0|           3|           0|           3|         -12|           0|         -12|           0|
|snowflak             |           0|           3|           0|           3|           0|           2|           0|           2|
|spots                |           0|           3|           0|           3|          -1|           0|          -1|           0|
|transparency_example |           0|           3|           0|           3|           0|           3|           0|           3|
|vasarely             |           0|           3|           0|           3|           0|           2|         -12|           0|
|waterfal             |           0|           3|           0|           3|           0|           2|           0|           2|
Comment 1 Alex Cherepanov 2024-03-12 00:55:34 UTC
Generated PDF files are badly broken. The following command is sufficient to demonstrate the problem in the current development version.

~/ghostpdl/debugbin/gs -dFastWebView=true -sDEVICE=pdfwrite -o empty.pdf -c  showpage

The file includes "%%Invocation" lines many times in wrong spots, for instance:

5 0 obj
%\C7쏢
%%Invocation: path/gs -dFastWebView=true -sDEVICE=pdfwrite ? ? ? ?
5 0 obj
<</Length 6 0 R/Filter /FlateDecode>>
stream
x\9C+T0\D03T0\00A(\9D\9C\CB\C8\005Ieendstream
endobj
Comment 2 Ken Sharp 2024-03-12 19:32:44 UTC
You probably need to disable ObjStm and XRef stream usage, because those won't be compatible with FastWebView. Personally I'd discard FastWebView instead.

If that solves the problem I'll look at automatically disabling those features when FastWebView is true.
Comment 3 Adrian Devries 2024-03-12 21:07:51 UTC
I can confirm that with "-dWriteXRefStm#false -dWriteObjStms#false -dFastWebView#true" the issue is gone.
Comment 4 Adrian Devries 2024-03-14 11:34:18 UTC
Please, note that there is another issue with regards to this case.

According to the following log files (cf. attached ZIP file), sometimes gsc reports RC=0 although errors occurred:

gs10030w32\grayalph-gs.log.bak
gs10030w32\spots-gs.log.bak
gs10030w64\doretree-gs.log.bak
gs10030w64\grayalph-gs.log.bak
gs10030w64\spots-gs.log.bak
gs10030w64\vasarely-gs.log.bak

So, gsc does not set the return code (or error level) correctly.
Comment 5 Ken Sharp 2024-03-14 11:38:45 UTC
(In reply to Adrian Devries from comment #4)
> Please, note that there is another issue with regards to this case.

If there is a different problem, then it needs a different report. It's terribly hard to control reports which have multiple issues. Its even harder to work out what went on for later investigators.

If you think there is a different problem then please open a new report.
Comment 6 Adrian Devries 2024-03-14 12:20:12 UTC
Done (cf. https://bugs.ghostscript.com/show_bug.cgi?id=707659).
Comment 7 Ken Sharp 2024-03-14 15:53:29 UTC
Fixed in commit 577ca904bd1dea00fefa7a4f9173d26a8e901487

Thanks for the report.
Comment 8 Adrian Devries 2024-05-22 06:25:47 UTC
Please, note that the issue has NOT been solved in Ghostscript 10.03.1. I am going to open a new case.
Comment 9 Ken Sharp 2024-05-22 07:07:44 UTC
(In reply to Adrian Devries from comment #8)
> Please, note that the issue has NOT been solved in Ghostscript 10.03.1. I am
> going to open a new case.

As with the other report you have commented on, this is NOT a security issue and therefore is not addressed in 10.03.1 since that is ONLY a security patch release.