Am Samstag, den 11.07.2020, 22:28 +0900 schrieb Masamichi Hosoda: > > 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.
Interesting. I had mostly looked at https://www.ghostscript.com/doc/Language.htm which lists setdevice, but not selectdevice. Do you happen to know what's making the difference here? These Ghostscript internals are funny to work with, being half- documented and partly standardized... Jonas
signature.asc
Description: This is a digitally signed message part