Cuminas DjVu SDK for .NET Framework
AddPageNotificationHandler Delegate



1-based index of the current page (frame).
Total number of pages (frames), that are queued to the encoder in the Encoder.AddPage/Encoder.AddPages method call.

The image passed to Encoder.AddPage/Encoder.AddPages method call.

This delegate is called for each page during a Encoder.AddPage/Encoder.AddPages method call.
Syntax
Public Delegate Function AddPageNotificationHandler( _
   ByVal current As Integer, _
   ByVal max As Integer, _
   ByVal img As Image _
) As Boolean
Dim instance As New AddPageNotificationHandler(AddressOf HandlerMethod)
public delegate bool AddPageNotificationHandler( 
   int current,
   int max,
   Image img
)
public delegate bool AddPageNotificationHandler( 
   int current,
   int max,
   Image^ img
)

Parameters

current
1-based index of the current page (frame).
max
Total number of pages (frames), that are queued to the encoder in the Encoder.AddPage/Encoder.AddPages method call.
img

The image passed to Encoder.AddPage/Encoder.AddPages method call.

Return Value

To encode the page, the delegate should return true; otherwise the page is not encoded.
Example
Sample to skip large images
Copy Code
Encoder enc = new Encoder();
enc.AddPageNotification += (current, max, image) => {
    if (image.Width > 6000 || image.Height > 6000)
        return false; // The image is too large, we will skip this
    return true;
};
// TIFF file may contain several pages
enc.AddPages("image.tif");
Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Reference

AddPageNotificationHandler Members
DjVu Namespace
Encoder Class
AddPage Method
AddPages Method

Send Feedback