hello, hope you are doing well,
Thank you for your question, I didnt know pdfgrep :p
First, I downloaded a pdf (this one exactly https://www.docker.com/wp-content/uploads/2022/03/docker-cheat-sheet.pdf)
then I tried the simple:
❯ pdfgrep '\n' docker-cheat-sheet.pdf
but didnt work as you know.
Then like you, I tried this:
pdfgrep '\\n' docker-cheat-sheet.pdf
but there was no output.
I decided to try to escape the \n with an echo command to test:
as expected, this interprete the \n:
❯ echo -e "test\ntest"
test
test
then I tried this, but it didnt work also:
❯ echo -e "test\\ntest"
test
test
then I tried this, and it worked with the echo command:
❯ echo -e "test\\\ntest"
test\ntest
So i decided to try it on the pdf, but still no output:
❯ pdfgrep '\\\n' docker-cheat-sheet.pdf
then, I have found this topic: pdfgrep pattern to include/exclude linebreak
and tried this:
❯ pdfgrep -P '\n' docker-cheat-sheet.pdf
I think this do the job, is it what you was looking for?
bguess