Oh good, that actually does work. The last time I tried to use GS in vector-to-vector filter mode, I found it had produced an output file in which the fonts superficially looked right but were in fact rasterisations of the originals, which annoyed me.
Mind you, I think that was using pswrite rather than pdfwrite. Perhaps I was hasty in concluding that it would apply to both.
(by just changing your -sDEVICE=pnggray to -sDEVICE=pdfwrite)
Mind you, I think that was using
pswriterather thanpdfwrite. Perhaps I was hasty in concluding that it would apply to both.