IPageSavingCallback interface

Represents a callback that is called when each page in multi page document is saved to a separate stream.

public interface IPageSavingCallback


OnFinish()Method which will be called when all pages are written.
PageSaving(PageSavingArgs)The method to be called when a page is saved to a stream.


Shows how to save multi page document to user-provided streams using page saving callback.

public void UsePageSavingCallbackToSavePageToSeparateStreams()
    var project = new Project(DataDir + "Homemoveplan.mpp");

    var imageSaveOptions = new ImageSaveOptions(SaveFileFormat.Png);

    var callback = new CustomPageSavingCallback();
    imageSaveOptions.PageSavingCallback = callback;
    imageSaveOptions.RenderToSinglePage = false;
    project.Save(Stream.Null, imageSaveOptions);

    foreach (var streams in callback.PageStreams)
        // process each page stream

private sealed class CustomPageSavingCallback : IPageSavingCallback
    public List<MemoryStream> PageStreams { get; } = new List<MemoryStream>();

    public void PageSaving(PageSavingArgs args)
        var memoryStream = new MemoryStream();
        args.Stream = memoryStream;
        args.KeepStreamOpen = false;

    public void OnFinish()

See Also