1

I am looking for a way to display a PDF file version metadata without having to open the file AcrobatPro. Example: PDF Version 1.4 : I can easily do this on PC: right click on file, properties, select PDF tab, and it is displayed along with what application and pdf library produced it. On Mac, none of this shows in "Get Info" (command + I) nor using terminal and the mdls command. Any ideals on some commands and I could write a droplet script?

  • 1
    Isn't this info available in the "More Info" dropdown, second from top? What are you missing? – holroy Sep 17 '15 at 13:37
  • "On Mac, none of this shows in "Get Info" (command + I) nor using terminal and the mdls command." For PDF files the dropdown "More Info:" is null "--" – Jay Sep 17 '15 at 18:45
  • Strange... Some of this information shows in my info, the file creator – holroy Sep 17 '15 at 18:46
  • If all you want is the version, do file foo.pdf in a Terminal window. – lhf Feb 27 at 13:52
5

Phil Harvey's exiftool could be wrapped in a AppleScript droplet. As an example of the command:

exiftool -S -pdfversion FILE
  • ExifTool by Phil Harvey is what I'm going with. It's not a simple Simon solution for others that are looking for one, but this tool gets all the metadata about the PDF file. I am in the printing biz and this data helps resolve rip problems. Thanks fd0! I vote this my Answer – Jay Sep 17 '15 at 18:54
0

Normally, the PDF version number and other metadata should be available in the "More Info" section of the Get Info pane. (This includes Title, Author, Page count, Page size, Security/encryption settings, Content Creator and Encoding Software.) If you're not seeing that, then your Spotlight index probably needs re-indexing.

enter image description here

It is possible to query the PDF version info directly without any third-party tools. The following python script will list a variety of metadata from any PDF document(s) supplied as an argument.

#! /usr/bin/python
# -*- coding: utf-8 -*-

import sys
from Quartz import PDFDocument
from Foundation import NSURL

if __name__ == '__main__':

    for filename in sys.argv[1:]:
        filename = filename.decode('utf-8')
        pdfURL = NSURL.fileURLWithPath_(filename)
        pdfDoc = PDFDocument.alloc().initWithURL_(pdfURL)
        if pdfDoc:
            print "URL:", pdfDoc.documentURL()
            metadata = pdfDoc.documentAttributes()
            for key in metadata:
                print "{}: {}".format(key, metadata[key])
            print "Number of Pages:", pdfDoc.pageCount()
            print "Is Encrypted:", pdfDoc.isEncrypted()
            print "Is Locked:", pdfDoc.isLocked()
            print "Allows Copying:", pdfDoc.allowsCopying()
            print "Allows Printing:", pdfDoc.allowsPrinting()
            print "Version: {}.{}".format(pdfDoc.majorVersion(),pdfDoc.minorVersion())
        else: print "Cannot get this file. (Not a PDF? / Bad filename?)"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .