Initialize Method

The Initialize method initializes a thumbnail control with a reference to the PDF control that it will reflect from that point onwards.

Syntax

C#:

void Initialize( object pDispatch );

Parameters

pDispatch

This holds a reference to the Amyuni CreactiveX PDF control that will be associated with this thumbnail control.

Return Value

This method returns 0 upon success; returns another value upon failure. In a .NET environment, nothing is returned upon success, and an exception is thrown upon failure.

The example below shows the implementation of a button-Click handler on a form containing both a PDF control and a thumbnail control. The button causes a PDF document to be loaded into the control and then initializes the thumbnail control with it.

 

Example

private void buttonLoadFile_Click(object sender, EventArgs e)
{
    //iacThumbnailView1 is a control on your form
    // Open a PDF document from file
    System.IO.FileStream fileO = new System.IO.FileStream("file1.pdf", FileMode.Open, FileAccess.Read, FileShare.Read);
 
    pdfCreator1.Document.Open(fileO, "");            
    iacThumbnailView1.Initialize(pdfCreator1);
    iacThumbnailView1.RedrawAllThumbs();
}