I'm developing billing application, in that project I need to generate PDF,for that I use 'iTextSharp.dll' to generate pdf,Its work fine. After PDF generation, I need to print that PDF file in dot matrix printer(rolling paper), I want to stop the printer after the data over(if 5 line data is there, its should print only 5 line). My code as follow:
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("d:\\Bill1.pdf", FileMode.Create));
document.Open();
document.Add(table1);
PdfAction action = new PdfAction(PdfAction.PRINTDIALOG);
writer.setOpenAction(action);
document.close();