This gist https://gist.github.com/dwarring/1e4e056d84d6fe125262bba1da1f58fb does this using the Raku PDF module. Usage is:p2s2pdf-strip.raku in.pdf [out.pdf] # post-process ps2pdf output