Hello ,
I want to print the pdf as number of time as the user want . My pdf is single page and in my code below the user want to print the pdf 3 time , so i write the as below
int NumOfLabel = 3; /* want that the PDF print three time */
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(FileName);
//Use the default printer to print all the pages
//doc.PrintDocument.Print();
//Set the printer and select the pages you want to print
PrintDialog dialogPrint = new PrintDialog();
dialogPrint.AllowPrintToFile = true;
dialogPrint.AllowSomePages = true;
dialogPrint.PrinterSettings.Copies =(short)NumOfLabel;
dialogPrint.PrinterSettings.MinimumPage = 1;
dialogPrint.PrinterSettings.MaximumPage = doc.Pages.Count;
dialogPrint.PrinterSettings.FromPage = 1;
dialogPrint.PrinterSettings.ToPage = doc.Pages.Count;
if (dialogPrint.ShowDialog() == DialogResult.OK)
{
doc.PrintFromPage = dialogPrint.PrinterSettings.FromPage;
doc.PrintToPage = dialogPrint.PrinterSettings.ToPage;
doc.PrinterName = dialogPrint.PrinterSettings.PrinterName;
doc.PrintToPage = NumOfLabel;
for (i = 0; i < NumOfLabel; i++)
{
PrintDocument printDoc = doc.PrintDocument;
dialogPrint.Document = printDoc;
printDoc.Print();
}
}
The above code only print single copy of print of pdf 2 and 3rd copy is blank . so what i need to do