pdfinfo: Find Out PDF File Information From A UNIX / Linux Shell Prompt

Q. How do I find out more information about Portable Document Format (PDF) document from a shell prompt? How do I find out information such as what software used to create a pdf file, its page size, and its creation date etc, using the terminal?


A.
You need to use pdfinfo command which, prints the contents of the ‘Info’ dictionary (plus some other useful information) from a Portable Document Format (PDF) file.

ADVERTISEMENTS

pdfinfo to view tech information about a pdf file

Type the command as follows:
$ pdfinfo {file.pdf}
$ pdfinfo lecture5.pdf

Sample output:

Title:          Telecommunication Protocols Laboratory Course
Author:         kraj
Creator:        LaTeX with hyperref package
Producer:       dvips + GPL Ghostscript 8.62
CreationDate:   Thu Apr  1 11:32:03 2004
ModDate:        Thu Apr  1 11:32:38 2004
Tagged:         yes
Pages:          68
Encrypted:      no
Page size:      538 x 718 pts
File size:      1683167 bytes
Optimized:      yes
PDF version:    1.3

Specify the owner password for the PDF file. Providing this will bypass all security restrictions.
$ pdfinfo -opw password file.pdf
Specify the user password for the PDF file.
$ pdfinfo -upw password file.pdf

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • namjith Dec 21, 2012 @ 5:12

    how i get pdfinfo using php? i tried the following code but its not getting..please help
    exec(“pdfinfo ” .escapeshellarg($file_path).” | grep -i Pages:”)

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.