<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.6.25358.103" />

PrintPageEventArgs

public class PrintPageEventArgs : EventArgs
Provides data for the PrintPage event.
using System.Runtime.CompilerServices; namespace System.Drawing.Printing { [NullableContext(2)] [Nullable(0)] public class PrintPageEventArgs : EventArgs { public bool Cancel { get; set; } public Graphics Graphics { get; set; } public bool HasMorePages { get; set; } public Rectangle MarginBounds { get; } public Rectangle PageBounds { get; } [Nullable(1)] [field: Nullable(1)] public PageSettings PageSettings { [NullableContext(1)] get; } internal bool CopySettingsToDevMode { get; set; } = true; [NullableContext(1)] public PrintPageEventArgs([Nullable(2)] Graphics graphics, Rectangle marginBounds, Rectangle pageBounds, PageSettings pageSettings) { Graphics = graphics; MarginBounds = marginBounds; PageBounds = pageBounds; PageSettings = pageSettings; } internal void Dispose() { Graphics?.Dispose(); } internal void SetGraphics(Graphics value) { Graphics = value; } } }