I'm using Ghostscript to convert a PDF document into an EPS file.
My goal is to remove the textual information (while keeping the vector outlines of the text intact) in the PDF. I am doing so by converting to EPS and then converting it back PDF. (Of course, I don't expect to prevent people from running OCR to get the text.)
The command I used was:
gs -q -dNOCACHE -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=epswrite -sOutputFile=output.eps input.pdf
But when I convert the resulting EPS back to PDF, the original margin is mostly lost, the page size shrank, and texts on even-numbered pages are cropped on the right.
Is there a way to keep the original page size and margin during the conversion?
Another tool I tried was ps2eps
.
While it supports specifying a page size, it does not actually remove the textual information, so one could still select and copy text from the resulting PDF. This defeats my purpose.
Another drawback is that it only supports converting a single page, so I have to first convert my PDF to a set of single-page PS files using psselect
.