> Ghostscript seems to need `-sDEVICE=pdfwrite` to produce the PDF we expect. > > Is the device specifying way on the new method (without `-sDEVICE=pdfwrite`) > documented by Ghostscript documents? > If not, it is not a bug in my humble opinion.
I've found the documented way to specify Ghostscript devices without `-sDEVICE=pdfwrite`. It is using the operator `selectdevice`. https://www.ghostscript.com/doc/9.52/Use.htm#Output_device https://www.ghostscript.com/doc/9.26/Use.htm#Output_device Here is my experiment. ``` $ echo "mark /OutputFile (foo.new-documented.pdf) /PageSize [595.28 841.89] (pdfwrite) finddevice putdeviceprops setdevice (pdfwrite) selectdevice newpath fill (foo.ps) run" > gs-command-documented.ps $ gs -dNODISPLAY -dNOSAFER -dNOPAUSE -dBATCH -dAutoRotatePages=/None -dPrinted=false gs-command-documented.ps ...snip... $ qpdf --qdf foo.new-documented.pdf foo.new-documented.qdf $ diff -u foo.old-method.qdf foo.new-documented.qdf > old-to-documented.diff $ ``` As a result, the drawing operators in PDF are the same as the old method.