View Issue Details

IDProjectCategoryView StatusLast Update
0000512fileGeneralpublic2024-04-08 16:05
Reportervinc17 Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.45 
Summary0000512: PostScript page list (.dsc) misidentified as PostScript document
DescriptionThe 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 InformationI'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).
TagsNo tags attached.

Activities

vinc17

2024-03-20 14:20

reporter   ~0004023

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.

christos

2024-04-08 16:05

manager   ~0004031

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?

Issue History

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