Author Topic: Displaying PDF Page Size in Windows Explorer  (Read 6438 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 35
Re: Displaying PDF Page Size in Windows Explorer
« Reply #15 on: May 30, 2017, 01:44:54 AM »
I get the following error:

Object doesn't support this property or method 144 8

RTT

  • Administrator
  • *****
  • Posts: 778
Re: Displaying PDF Page Size in Windows Explorer
« Reply #16 on: May 30, 2017, 02:27:16 AM »
Little mistake in these new code lines (I didn't tested it previously). I've edited my post with the correct code now.

nightslayer23

  • Newbie
  • *
  • Posts: 35
Re: Displaying PDF Page Size in Windows Explorer
« Reply #17 on: May 30, 2017, 04:13:25 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.
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;
        }


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

RTT

  • Administrator
  • *****
  • Posts: 778
Re: Displaying PDF Page Size in Windows Explorer
« Reply #18 on: May 31, 2017, 12:55:53 AM »
Would I make this a new script? And a new Metadata field?
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.