PDF-ShellTools > General

Displaying PDF Page Size in Windows Explorer

<< < (7/7)

Nick Riviera:
Hello,
I work with pdfs that contains internal measurements (cropbox, trimbox..)
Can you make a script that show the  trim  and bleed box size in Windows Explorer ?
eg. 215.9 x 279.4mm+5mm
Thank you very much.


--- Code: ---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");
--- End code ---

RTT:
Check reply 5, at this trim + bleed size topic started by you.

chrisrace:
Hi - great scripts! We use a lot of PDF's (we're architects) would it be possible for this script to run automatically or create a ribbon button to run this automatically? Just wanting to make the process as simple as possible for the guys. Thanks Chris

RTT:
You may use the RunScript command line function to run the script from a shortcut, batch file, PowerShell script, etc.
But it's easy for the user to manually select the PDF files that have the specific column empty (sorting by that column), invoke the right click menu and call the script from the PDF-ShellTools sub-menu.

Navigation

[0] Message Index

[*] Previous page

Go to full version