How to find the year of publication of a ebook in pdf format?
Of course, with linux and the GNU tools!
The onliner command
find . -type f -iname "*.pdf" -print -exec pdfgrep -iPm1 'copyright\s*©\s*[0-9]{4}' {} \;
Find from current directory files that end by “.pdf” (case insensitive), print the relative path of matched results. For every finded file perform a pdfgrep and search in case insensitive the Pearl regex and if finds one match skip the grep in the rest of file.
The regex match with string:
“copyright”(zero or more spaces)(copyright symbol)(zero or more spaces)(secuence of 4 integers to match with the year number)
copyright\s*©\s*[0-9]{4}
Proof of concept
I test this on my new ebook bundle adquired in humble bundle “Linux mega bundle packt books” and this is the list of published years:

Here the pdf list with the result separated by dash:
./Linux_Service_Management_Made_Easy_with_systemd - Copyright © 2022 Packt Publishin
./Linux_Kernel_Debugging - Copyright © 2022 Packt Publishing
./Mastering_Linux_Device_Driver_Development - Copyright © 2020 Packt Publishing
./Digital_Forensics_with_Kali_Linux[Second_Edition] - Copyright © 2020 Packt Publishing
./Linux_Device_Driver_Development - Copyright © 2022 Packt Publishing
./Mastering_Linux_Security_and_Hardening - Copyright © 2020 Packt Publishing
./The_Ultimate_Kali_Linux_Book - Copyright © 2022 Packt Publishing
./Linux_Command_Line_and_Shell_Scripting_Techniques - Copyright © 2022 Packt Publishing
./Linux_System_Programming_Techniques - Copyright © 2021 Packt Publishing
./Migrating_Linux_to_Microsoft_Azure - Copyright © 2021 Packt Publishing
./Linux_for_Networking_Professionals - Copyright © 2021 Packt Publishing
./SELinux_System_Administration[Third_Edition] - Copyright © 2020 Packt Publishing
./Windows_Subsystem_for_Linux_2_(WSL_2)_Tips,_Tricks,_and_Techniques - Copyright © 2020 Packt Publishing
./Mastering_Embedded_Linux_Programming - Copyright © 2021 Packt Publishing
./Hands-On_Linux_Administration_on_Azure[Second_Edition] - Copyright © 2019 Packt Publishing
./Linux_Kernel_Programming - Copyright © 2021 Packt Publishing
./Hands-On_Enterprise_Automation_on_Linux - Copyright © 2020 Packt Publishing
./Mastering_Linux_Security_and_Hardening[Third_Edition] - Copyright © 2023 Packt Publishing
./Windows_and_Linux_Penetration_Testing_from_Scratch - Copyright © 2022 Packt Publishing
./Mastering_Linux_Administration - Copyright © 2021 Packt Publishing
./Linux_Kernel_Programming_Part_2-Char_Device_Drivers_and_Kernel_Synchronization - Copyright © 2021 Packt Publishing
./Mastering_Kali_Linux_for_Advanced_Penetration_Testing - Copyright © 2022 Packt Publishing
./Red_Hat_Enterprise_Linux_9_Administration - Copyright © 2022 Packt Publishing
./Linux_Administration_Best_Practices - Copyright © 2022 Packt Publishing
./Red_Hat_Enterprise_Linux_8_Administration - Copyright © 2021 Packt Publishingg
Maybe in a future project I’ll make a bash script that automates this and adds information from the pdf’s metadata to get the title or with pdfgrep and regexp find the real ebook title…
Devops in linux have no borders 😄