PDF-ShellTools > General

Displaying PDF Page Size in Windows Explorer

<< < (4/4)

I get the following error:

Object doesn't support this property or method 144 8

Little mistake in these new code lines (I didn't tested it previously). I've edited my post with the correct code now.


--- Quote from: RTT on May 26, 2017, 01:00:25 AM ---
--- Quote from: nightslayer23 on May 25, 2017, 06:17:51 AM ---Sometimes it works, sometimes not. Must be some glitch where if a pdf has been rotated to landscape, it takes on the original length and width and not the update rotation. I wanted to be able to differentiate Landscape and Portrait files from one another but it doesn't seem possible for some reason.

--- End quote ---
Indeed, the page width/height properties are not taking into account the page rotation! I will have this fixed in the next release.
Meanwhile, you can also check the page rotation:

        if (Page.Rotation == 90 || Page.Rotation == 270) {
            var w = Page.Height;
            var h = Page.Width;
        } else {
            var w = Page.Width;
            var h = Page.Height;

--- End quote ---

Would I make this a new script? And a new Metadata field?


--- Quote from: nightslayer23 on May 30, 2017, 04:13:25 AM ---Would I make this a new script? And a new Metadata field?

--- End quote ---
This is just a code snippet, not a complete script, for you to use in the script you told was not working correctly when the pages where rotated.
A new script, or metadata field, depends if you also need the info from the original script. If not, you may just adapt the original script to your needs and store the info in the same field.
But the first script only gets the size of the first page, so if you need to know all the different sizes of the document, the code needs to be changed.
The newest script, that returns the list of sizes using the names for the standard paper sizes, is not useful for this as and A4 sheet is still A4 size even if landscape.


[0] Message Index

[*] Previous page


Go to full version