Remove Active Content (Links) from a LaTeX PDF Using Ghostscript
Terminal — flatten a LaTeX PDF $ gs -dNOPAUSE -sDEVICE=pdfwrite \\ -sOUTPUTFILE=NEW_FILE.pdf -dBATCH in.pdf Processing pages 1 through 3. Page 1 ... Page 2 ... Page 3 NEW_FILE.pdf active links removed A PDF produced from LaTeX often carries "active" content: clickable hyperlinks, internal cross-reference links, bookmarks, and sometimes form fields or embedded JavaScript. When you need a flat, static PDF for printing, archiving, or submitting to a system that rejects interactive elements, the simplest reliable tool is Ghostscript. This tutorial shows how to strip that active content by re-distilling the file through Ghostscript's pdfwrite device. Step 1: Install Ghostscript On macOS, install it with Homebrew: brew install ghostscript On Debian or Ubuntu use sudo apt install ghostscript ; on most Linux distributions Ghostscript is packaged as ghostscript and provides the gs command. Step 2: Re-distill the PDF Run the source PDF back through Ghostscript...