Skip to main content
ChristianBahnsen
Inspiring
November 25, 2016
Question

powershell -- iterate over a collection of PDFs looking for those with specific info.subject

  • November 25, 2016
  • 3 replies
  • 1681 views

Does anyone know how to iterate over a collection of PDFs using Powershell, looking for documents with specific information stored in one of the info properties, e.g., info.subject?

As part of a document-workflow process I'm working on, I'm going to be storing values in some of the info properties, viz., Author, Subject, and Keywords.  It would be very useful to later be able to find PDF documents that have specific information stored in those properties.

Thanks

Christian Bahnsen

This topic has been closed for replies.

3 replies

Inspiring
November 25, 2016

Probably not unless, one copies the Exif data from the PDF tags to the EXIF tags and that might not be a perfect match.

ChristianBahnsen
Inspiring
November 25, 2016

I'll look into the EXIF thang.

This article, How can I read out internal pdf creation/modified date with Windows PowerShell? - Super User , says that PDFs can be opened as if they were text files.  I've tested it and it's true.  I see the info properties are stored with some xml-like tags.  I haven't had time to do it yet, but I may be able to use regular expressions or perhaps XSLT to read the info properties.

In Windows, if you look at the Properties for a PDF document, on the PDF tab you can see some of the info properties.  Ideally, I'd be able to access those properties without having to actually open the PDF.

Again, it would be very useful for us to be able to find the PDFs with specific values in the info properties.

Christian

Inspiring
November 25, 2016

That tab and the interface between a PDF and specific OS's is constantly changing.