Need to get links or more data (for example binding layer from QuarkXPress application) from pdf to text, in terminal.
Tried pdftotext, but seems links are not exported, pdfgrep is the same.
Is there any solution?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Using pdfx and filtering all lines starting with
pdfx -v file.pdf | sed -n 's/^- \(http\)/\1/p'
First, you need to check if your pdf is compressed or not, see:
If it's compressed, you need to uncompress it.
Then, you can extract links using
strings uncompressed.pdf | grep -Eo '/URI \(.*\)' | sed 's/^\/URI (//g; s/)$//g'