pdfinfo.exe isn't working on Powershell

0

I am trying to do the PowerShell script outlined in the answer here. The question and solution reference "pdfinfo.exe" and "pdfinfo". When I research this, it looks like it should be packaged in some versions of PowerShell but not others. On my machine, the command is not recognized. How might I get this package without downloading a corrupt or malicious file? I am trying to get a total page count of multiple pdf files within a folder structure.

I am using Windows 10 and Powershell / ISE version 5.1.17763.503

Thanks!

Theresa Bryson

Posted 2019-06-18T19:04:57.733

Reputation: 1

2pdf - Windows equivalent for Unix's pdfinfo - Stack Overflow – DavidPostill – 2019-06-18T19:20:06.973

Thanks for the link. I have downloaded the files but the command still does not work even after an install of the closed version. Is there some step I have missed? – Theresa Bryson – 2019-06-18T19:32:33.100

Did you specify the full path of pdfinfo? – harrymc – 2019-06-18T19:42:01.143

2

Add pdfinfo to your PATH. See http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

– DavidPostill – 2019-06-18T19:45:42.820

This seems odd, are you absolutely sure this is supposed to work with PowerShell 5.1 instead of PowerShell Core? From what I can tell pdfinfo is a Linux utility, not a Windows utility.

– Ramhound – 2019-06-18T20:23:21.993

Answers

1

When I research this, it looks like it should be packaged in some versions of PowerShell but not others.

pdinfo is not included with PowerShell on Windows. It actually isn't a Windows utility.

However, a Windows port does exist, here. Your script will not work without it.

On my machine, the command is not recognized. How might I get this package without downloading a corrupt or malicious file?

I cannot speak to the legitimacy of the source I have provided. I am only answering this question due to the mistaken belief it's supposed to be installed and/or otherwise included with PowerShell.

The tool in question has nothing to do with PowerShell it is simply a utility being called from a PowerShell script in the answer you linked to.

Source: Windows equivalent for Unix's pdfinfo

Ramhound

Posted 2019-06-18T19:04:57.733

Reputation: 28 517