PDFs can be formed by pages with different sizes, in the same document, so I'm going to assume the PDFs in question are not in this situation and/or knowing the page size of the first page is sufficient to your needs.
First you need to create a custom field, that will hold the page size, in order to cache the value. Calculating this on the fly is, because of the time it takes, not suited to the Shell responsiveness requirements.
This a done using the PDF-ShellTools manager,
custom fields editor, for the property handler extension. There is only the need to add a new custom field and name it with appropriated label (e.g. "page size") and name (e.g. PageSize). Check the first attached screenshot for details.
You may also click the advanced button and define this new metadata field as read only.
Click the "apply changes" button to register this new property in the system. It is now possible to set visible the "page size" column in the details view of the Windows Explorer, but it will show empty because we first need to fill it.
To fill this new metadata property we will use a
My Scripts script.
var ProgressBar = pdfe.ProgressBar;
ProgressBar.max = pdfe.SelectedFiles.Count;
for (var i = 0; i < pdfe.SelectedFiles.Count; i++) {
ProgressBar.position = i + 1;
var file = pdfe.SelectedFiles(i);
var Page = file.Pages(0);
if (Page) {
var w = Math.min(Page.Width, Page.Height);
var h = Math.max(Page.Width, Page.Height);
var PSizeStr = w.toFixed() + 'x' + h.toFixed();
var FileMetadata = file.Metadata;
if (FileMetadata.PageSize !== PSizeStr) {
FileMetadata.PageSize = PSizeStr;
if (FileMetadata.CommitChanges()) {
pdfe.echo(file.Filename + ' : (' + PSizeStr + ') [OK]');
} else {
pdfe.echo(file.Filename + ' [commit changes failed]', 0xFF0000);
}
} else {
pdfe.echo(file.Filename + ' : (' + PSizeStr + ') [already set]');
}
}
}
pdfe.echo("Done");
I've attached it bellow, so you just need to unzip and import it, from the manager, context menu extension, my scripts functionality.
Now you just need to run this script on all the PDFs you need to know the page size, to have these PDFs metadata to include a new PageSize named property that hold the document first page size in the Width x Height [millimeters] format (the script can be easily changed to use different units).
All these processed PDFs will now show in the Windows Explorer details view (if the "page size" column is set visible), the value that you can now use to easily sort/manage these PDFs.
For new/not yet process PDFs, you just need to run the script on these PDFs too.
Let me know if you are missing to understand any of the steps.
Regarding your second question, about showing the number of pages for PDF documents. After having the PDF-ShellTools installed, the Windows property system "pages" column will show the number of pages for PDFs too, as it is one of the PDF metadata properties ready available from the PDF-ShellTools PDF property handler shell extension. You just need to set visible that column in the Windows Explorer details view.