How many pages are consumed when processing a document?

Question

What is the Engine's method to find out how many pages the Engine charges for the currently processed document?

Answer

This can be calculated by getting the remaining number of pages in the license using the VolumeRemaining property of the License object before and after calling the Process or any other method that increments the license counter (you can find the complete list of such methods in the Developer's Help), for example:

// C++ (Raw)
CSafePtr<ILicense> license;
Engine->get_CurrentLicense(&license);

int volumeBeforeProcessing = 0;
license->get_VolumeRemaining(LCT_Pages, &volumeBeforeProcessing);

frDocument->Process();

int volumeAfterProcessing = 0;
license->get_VolumeRemaining(LCT_Pages, &volumeAfterProcessing);

int numberOfUsedPages = volumeBeforeProcessing - volumeAfterProcessing;

Note: This property applies to licenses with limited counters. For unlimited ones, the parameter holds the maximum positive value for a 32-bit signed binary integer, 2147483647.

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.