menu

Document Processing

PdfDocumentBase.ProgressEventHandler Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfDocumentBase.ProgressEventHandler Class

    Delegate for the PdfDocumentBase.ProgressEventHandler event.

    Inheritance
    System.Object
    PdfDocumentBase.ProgressEventHandler
    Namespace: Syncfusion.Pdf
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public sealed class ProgressEventHandler : MulticastDelegate
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add new pages to the document.
    PdfPage page = document.Pages.Add();
    //Create font and font style.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
    //Draw text in the new page.
    page.Graphics.DrawString("Essential PDF", font, PdfBrushes.Black, new PointF(10, 10));
    document.SaveProgress += new PdfDocument.ProgressEventHandler(document_SaveProgress);
    //Saves the document
    document.Save("Document.pdf");
    Close the document
    document.Close(true);
    //  Handles the event
    void document_SaveProgress(object sender, ProgressEventArgs arguments)
    {
      MessageBox.Show(String.Format("Current: {0}, Progress: {1}, Total {2}", arguments.Current, arguments.Progress, arguments.Total));
    }
    'Create a new PDF document.
    Private document As PdfDocument = New PdfDocument()
    'Add new pages to the document.
    Private page As PdfPage = document.Pages.Add()
    'Create font and font style.
    Private font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
    'Draw text in the new page.
    page.Graphics.DrawString("Essential PDF", font, PdfBrushes.Black, New PointF(10, 10))
    AddHandler document.SaveProgress, AddressOf document_SaveProgress
    'Saves the document
    document.Save("Document.pdf")
    'Close the document
    document.Close(True)
    '  Handles the event
    Private Sub document_SaveProgress(ByVal sender As Object, ByVal arguments As ProgressEventArgs)
     MessageBox.Show(String.Format("Current: {0}, Progress: {1}, Total {2}", arguments.Current, arguments.Progress, arguments.Total))
    End Sub

    Constructors

    ProgressEventHandler(Object, IntPtr)

    Declaration
    public ProgressEventHandler(object object, IntPtr method)
    Parameters
    Type Name Description
    System.Object object
    System.IntPtr method

    Methods

    BeginInvoke(Object, ProgressEventArgs, AsyncCallback, Object)

    Declaration
    public virtual IAsyncResult BeginInvoke(object sender, ProgressEventArgs arguments, AsyncCallback callback, object object)
    Parameters
    Type Name Description
    System.Object sender
    ProgressEventArgs arguments
    System.AsyncCallback callback
    System.Object object
    Returns
    Type
    System.IAsyncResult

    EndInvoke(IAsyncResult)

    Declaration
    public virtual void EndInvoke(IAsyncResult result)
    Parameters
    Type Name Description
    System.IAsyncResult result

    Invoke(Object, ProgressEventArgs)

    Declaration
    public virtual void Invoke(object sender, ProgressEventArgs arguments)
    Parameters
    Type Name Description
    System.Object sender
    ProgressEventArgs arguments
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »