Finding PDF files that are password protected, Script Columns

Hi,

How do I find all PDF files on my drives that are password protected ?

I am using *.pdf in Name Matching and I searched through the various drop down selections like Document, Script Column available in Advanced but could not find any thing that will help me with finding password protected files.

Currently, I am looking to find only PDF that are password protected but in future if I want to expand this to other password protected files for Compresed files like .zip, .rar or Microsoft Office documents (.docx, .xlsx or .doc, .xls) etc. is there any way this can be achieved using the Find Files.

I am also using scripts to get additional columns like number of Pages in PDF .

image

It shows the column EE.PageCount in Script column

image

As this is a number, how do I provide a value in Enter text here to match to find all PDF files which are > 100 pages, = 1 page, < 10 pages and so on.

Refer to the the post Column to display number of pages for eBooks and https://resource.dopus.com/uploads/default/original/3X/2/d/2dbbf147919fac5d38a10bf8d1b8f6c0b96997ff.zip for the script file.

Thanks and Regards,

edou

That might be something your PDF software adds a column to File Explorer for. If so, the column could be imported into Opus (the same as the page count column is being imported in the script you linked to).

If there isn't a column in File Explorer for that information, you could look for a tool which adds one, or try making an Opus-specific script column, which would have to parse the PDF files to work out if they are encrypted or not. I don't know enough about the PDF format to say if that would be difficult or easy.

There is no general way to know if a file is encrypted (outside of NTFS encryption at the filesystem level, but that isn't what we're talking about here). The way to know will be different for each type of file.

Try editing the script to add col.type = "number" to the column definition, then clear the filter and create a new one:

option explicit

' pdfPageCount
' (c) 2018 sfranky

' This is a script for Directory Opus.
' See https://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.


' Called by Directory Opus to initialize the script
Function OnInit(initData)
	initData.name = "PDF page count"
	initData.desc = "Adds PDF Columns"
	initData.copyright = "(c) 2018 sfranky"
	initData.version = "1.0"
	initData.default_enable = true
	initData.min_version = "12.0.8"
	Dim props, prop, col
	Set props = DOpus.FSUtil.GetShellPropertyList("System.Document.PageCount", "r")
	for each prop in props
		Set col = initData.AddColumn
'		col.name = prop.raw_name
		col.name = "PDFPages"
		col.method = "OnPDFColumn"
		col.label = "PDFPages"
		col.justify = "left"
		col.autogroup = true
		col.userdata = prop.pkey
		col.type = "number"
	next
End Function
Function OnPDFColumn(scriptColData)

	scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)

End Function

I searched Google search and found utilities which add shell extensions and other functionalities like columns to File Explorer. However, I could not find any where it would identify protected file in File Explorer.

But I also came upon a free utility which does find protected PDF files and am sharing it here. It is useful in standalone mode and someone may find it useful.

If someone can figure out which PDF attribute it uses and if there is any way to incorporate it in Dopus Find Files, that will be great.