I have a PDF document which has hyperlinks at the bottom of each page. Last week I successfully removed them using the trial version of Adobe Acrobat X Pro on Windows, however since then I've mislaid the new document and I've installed Ubuntu 14.04. Is there a way I can programmatically do a (Tools > Edit Tool > Delete) action as I did on Windows using something like Ghostscript? I don't want to reinstall Windows, but I will if there's no alternative.
As for this answer on TexExchange, discarding hyperlinks in PDFs is actually the default in ghostscript. So simply running it like this will do the trick:
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/prepress \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=output.pdf \
input.pdf
You would need to set the option "-dPrinted=false"
in order for ghostscript to leave hyperlinks in the output PDF.
Using gs 9.27, apparently the default behaviour changed, i needed
-dPreserveAnnots=false
to remove hyperlinks.
Source: https://www.ghostscript.com/doc/current/VectorDevices.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With