View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000512 | file | General | public | 2024-03-20 13:55 | 2024-04-08 16:05 |
Reporter | vinc17 | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | feedback | Resolution | open | ||
Product Version | 5.45 | ||||
Summary | 0000512: PostScript page list (.dsc) misidentified as PostScript document | ||||
Description | The pdf2dsc script from Ghostscript can generate a .dsc file consisting of a PostScript page list. This file looks like a real PostScript document, but it cannot normally be read with a PostScript viewer (actually, it is not the intent). Thus "file" should not identify it as a PostScript document like what it currently does. | ||||
Steps To Reproduce | $ cat test.dsc %!PS-Adobe-3.0 %%DocumentMedia: y841.89x595.276 595.276 841.89 70 white () %%Pages: 1 %%EndComments %%BeginProlog /Page null def /Page# 0 def /PDFSave null def /DSCPageCount 0 def /DoPDFPage {dup /Page# exch store dup dopdfpages } def %%EndProlog %%BeginSetup (test.pdf) (r) file { DELAYSAFER { .setsafe } if } stopped pop runpdfbegin process_trailer_attrs %%EndSetup %%Page: 1 1 %%PageMedia: y841.89x595.276 1 DoPDFPage %%Trailer runpdfend %%EOF $ file test.dsc test.dsc: PostScript document text conforming DSC level 3.0 It should have output something like "PostScript DSC file". I'm not sure about "file -i"; I'd say that text/plain is more appropriate than application/postscript since such files will typically be viewed with a text viewer. | ||||
Additional Information | I'm not sure how such a file can be identified. Perhaps looking for "/DSCPageCount 0 def" (which is guaranteed to be there, as this can be seen in lib/pdf2dsc.ps from Ghostscript). | ||||
Tags | No tags attached. | ||||
|
Additional information: The file seemed to have been "readable" by some PostScript viewers in the past, as one can see at https://bugs.ghostscript.com/show_bug.cgi?id=697529 but as said by the Ghostscript developer, the .dsc file "uses Ghostscript-specific PostScript extensions" and a user should not generate such a file if the goal is to get a PostScript file readable by a PostScript viewer. So, what's important is that such a file should be regarded as some form of plain text file. |
|
DSC is https://en.wikipedia.org/wiki/Document_Structuring_Conventions. I am not sure how to identify the specific ghostscript extensions. Can the ghostscript developer give some hints on how to identify them? |
Date Modified | Username | Field | Change |
---|---|---|---|
2024-03-20 13:55 | vinc17 | New Issue | |
2024-03-20 14:20 | vinc17 | Note Added: 0004023 | |
2024-04-08 16:04 | christos | Assigned To | => christos |
2024-04-08 16:04 | christos | Status | new => assigned |
2024-04-08 16:05 | christos | Status | assigned => feedback |
2024-04-08 16:05 | christos | Note Added: 0004031 |