Propagating the "Pages" Metadata

Anonymous user
Propagating the "Pages" Metadata

Greetings,

The extension is fantastic, thank you for writing it.

Is there a way to have it fill out the "Pages" property as well?  That would be super helpful to know how many pages are in a PDF without haveing to open it.

 

Thanks again for your efforts!

-Thom K.

Posts: 1125
Joined: March 25, 2012 - 01:19
Re: Propagating the "Pages" Metadata

Page count is not a ready-made metadata, available somewhre in the PDF file; it must be calculated by parsing all the pages.
I suppose this will slow down things a lot...

Will investigate more but I'm pretty sure there's no easy fix.

Posts: 4
Joined: May 31, 2017 - 00:32
Re: Propagating the "Pages" Metadata

I know I'm reviving an old thread, but given the speed of computers and hard drives (especially as SSDs become more prevalent), have you changed your mind about quickly doing a page count of the file(s) to provide that as a property?

Posts: 1125
Joined: March 25, 2012 - 01:19
Re: Propagating the "Pages" Metadata

That feature was on my TODO list for so much time; I started experimenting on it a long time ago, but never completed.

Now it is: just released version 1.9.0 with Page count support!

Please let me know if it works as expected...

Posts: 4
Joined: May 31, 2017 - 00:32
Re: Propagating the "Pages" Metadata

Some files it counts the pages and some it doesn't. I can't see a pattern to it. (I thought initially it was size related, but I checked other folders and even smaller files it wouldn't propagate the page count.)

I wouldn't mind sharing the data with you, but I'd need it to be private.

Posts: 1125
Joined: March 25, 2012 - 01:19
Re: Propagating the "Pages" Metadata

I suppose that the non-working files contain object streams, one of the PDF features not yet supported by the extension.
I already have an ongoing branch to support them, but it's still almost incomplete.

Having the Pages object packed into an object stream is not so common (I've seen in only 1 of my 30 test files collection), because Pages should be easily available; anyway PDF specifications allows it, so we have to agree...

I'd like to have a look to one of those files.
Send it through the contact form and remember me to keep it private.

Posts: 4
Joined: May 31, 2017 - 00:32
Re: Propagating the "Pages" Metadata

Sample file sent. Hopefully it helps you find and verify what needs to be done to get the pages property populated.

Thank you.

Posts: 1125
Joined: March 25, 2012 - 01:19
Re: Propagating the "Pages" Metadata

I've checked the file you've sent and it won't show ALL of the document properties, not only the Pages count.
That was caused by a small bug in reading the trailer dictionary, now fixed.

Attached here a test version of the extension with the fix, together with some speed improvements.

coolsoft wrote:
Having the Pages object packed into an object stream is not so common (I've seen in only 1 of my 30 test files collection), because Pages should be easily available; anyway PDF specifications allows it, so we have to agree...
I still have to find a PDF file with that kind of layout: it's allowed by PDF specifications but not so commonly used.
Feel free to test the test version and report any other file with missing Pages count (or other properties).

PS: I've deleted your sample PDF file, don't worry ;)

Attachments (Only registered users)
PdfPropertyExtension_1.10.0-RC1.zip
Posts: 4
Joined: May 31, 2017 - 00:32
Re: Propagating the "Pages" Metadata

It worked wonderfully!

Now if I could just this extension to display its pages column in Directory Opus.

Posts: 1125
Joined: March 25, 2012 - 01:19
Re: Propagating the "Pages" Metadata

Just released version 1.10.0 that adds support to encrypted/protected documents and improves page count support.

warning

Warning, JavaScript is disabled!

JavaScript is not available, maybe because you disabled it globally into your browser settings or you are using an addon like NoScript.

We do not have any dangerous JavaScript running here.
Please enable JavaScript; if you're using NoScript this image will help you adding CoolSoft to your whitelist.

Thanks for your comprehension and enjoy CoolSoft.