You are viewing limited content. For full access, please sign in.

Question

Question

SDK Script to Return PageCount

asked on April 1, 2021

Hi,

I am looking at trying to build a WF that returns the page count of the contents of a folder using WF SDK Toolkit.

I search the repository and then use the For Each Entry action but don't know what is the most economical way of pulling the page count from each document and totalling up into a Token.

Thanks

0 0

Replies

replied on April 1, 2021

You can get the page count with the FolderStatistics class:

FolderInfo folder = (FolderInfo)entry;
FolderStatistics folStats = folder.GetStatistics(EntryDepth.Infinite);
long totalPages = folStats.PageCount;

 

1 0
replied on April 1, 2021

Hi Robert,

 

 

Thanks for the super fast reply.  Just to clarify, FolderStatistics will return the total page count of a Folder in LF?

Currently the script is returning : The name 'entry' does not exist in the current context

 

Anthony

0 0
replied on April 1, 2021

Yes, FolderStatistics will crawl the folder tree and sum up the pages.

 

The sample code is generic, I think to get it working in a script activity you need to rename rename 'entry' to 'BoundEntryInfo'. 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.