Hello,
As per my understanding the requirement is to cancel print when user closes or cancel the preview dialog form.
So here assuming the print option will be chosen from the preview dialog form ,
My suggestion is to remove the pdoc.Print() call .
if (result == DialogResult.OK)
{
PrintPreviewDialog ppd = new PrintPreviewDialog();
ppd.Document = pdoc;
ppd.ShowDialog();
// pdoc.Print(); /* remove this call as user will print from preview form or cancel out*/
}
I created as demo code and it works .
Note : I added a blank pdoc_PrintPage() handler as below.
private void pdoc_PrintPage(object sender, PrintPageEventArgs e)
{
}
Thanks