PDF-ShellTools > General

rename page size file

(1/2) > >>

Urraco:
Hi
I have a hundreds of pdf files

I do not want to open every pdf file to see what format is...
It's possible to rename this files whit page size included?

Ex: Test.pdf   =  > Test_210x297 mm.pdf

Many thanks!!!

RTT:
A better method would be to show the sizes in a Windows Explorer column, as discussed in this forum thread: Displaying PDF Page Size in Windows Explorer.

But, if you really want to go with the file rename method, you may use the rename tool, with the help of this script (also attached bellow).

--- Code: ---function PageSize() {
    var Size = '';
    var Page = BatchFile.Pages(0);
    if (Page) Size = Page.Width.toFixed() + 'x' + Page.Height.toFixed() + ' mm';
    BatchFile.close();
    return Size;
}

--- End code ---

Select all the files you want to rename and start the rename tool. Click the tool rename formula field right arrow and, from the menu that will show up, open the scripts editor, menu item "Scripts>Manage Scripts...". From this script editor main menu, import the bellow attached script (after unzipped) and close the editor (saving the changes).
You can now type [F]_[PageSize] in the tool rename formula field, to achieve the file name schema you are requesting.

Urraco:
Thank you for your prompt answer!
Apparently it works, but when I try to rename the file, I get this error: Unable to rename file - The process cannot access the file because it is being used by another process.
..and..can i get the "trim" page size format of pdf ?

Thanks and a good day!

RTT:

--- Quote from: Urraco on May 23, 2019, 10:32:41 AM ---Apparently it works, but when I try to rename the file, I get this error: Unable to rename file - The process cannot access the file because it is being used by another process.

--- End quote ---
My bad. I've update the above script to fix the issue.


--- Quote from: Urraco on May 23, 2019, 10:32:41 AM ---..and..can i get the "trim" page size format of pdf ?

--- End quote ---
Do you mean the size of the PDF page trimbox, that reverts to the cropbox, or mediabox, if that box property is not defined?

Urraco:

--- Quote from: RTT on May 23, 2019, 03:14:47 PM ---
--- Quote from: Urraco on May 23, 2019, 10:32:41 AM ---Apparently it works, but when I try to rename the file, I get this error: Unable to rename file - The process cannot access the file because it is being used by another process.

--- End quote ---
My bad. I've update the above script to fix the issue.


--- Quote from: Urraco on May 23, 2019, 10:32:41 AM ---..and..can i get the "trim" page size format of pdf ?

--- End quote ---
Do you mean the size of the PDF page trimbox, that reverts to the cropbox, or mediabox, if that box property is not defined?

--- End quote ---


I updated the script but still same error." Unable to rename..."
About format if you can, i want to get trimbox size of the pdf document and if does not contain trim size, return cropbox or mediabox size

Thanks


Navigation

[0] Message Index

[#] Next page

Go to full version