>> From the same PostScript file, the new method generates a PDF of >> 7081 bytes and the old method generates a PDF of 6423 bytes. The >> new method is more than 10 % larger than the old method. > > Do you consider this a bug in gs or a feature? > >> From `old-to-new.diff`, it seems that the amount of drawing >> operators in the /Contents has increased significantly. > > OK. What do you think about opening a ghostscript issue, asking the > developers for an explanation? Maybe our new method can be slightly > adapted to avoid the size increase.
I tried another method that adds `-sDEVICE=pdfwrite -sOutputFile=/dev/null` and removes `-dNODISPLAY` from the new method. ``` $ gs -dNOSAFER -dNOPAUSE -dBATCH -dAutoRotatePages=/None -dPrinted=false -sDEVICE=pdfwrite -sOutputFile=/dev/null gs-command.ps ...snip... $ qpdf --qdf foo.new-method.pdf foo.new-method.qdf $ diff -u foo.old-method.qdf foo.new-method.qdf > old-to-new.diff $ ``` As a result, the drawing operators in PDF are the same as the old method. 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.