Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- saveReportPdf.Filter = "PDF Files|*.pdf";
- try
- {
- string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)+"\\RentCarAppLast desktop\\printInvoice.pdf";
- saveReportPdf.FileName = path;
- doc = new Document();
- string nameFile = saveReportPdf.FileName;// + " NO-" + rentIdTxt.Text;
- PdfWriter.GetInstance(doc, new FileStream(nameFile, FileMode.Create));
- doc.Open();
- FillTaxInvoiceParameters();
- CreatePdfInvoice();
- doc.Close();
- Process p = new Process();
- p.StartInfo = new ProcessStartInfo()
- {
- //CreateNoWindow = true,
- FileName = path,
- Verb = "printto",
- Arguments = "\"" + "printerName" + "\"",
- //UseShellExecute = true,
- };
- p.Start();
- //Thread.Sleep(1000);
- p.WaitForInputIdle();
- p.Kill();
- }
- catch (IOException IO)
- {
- MessageBox.Show(IO.Message, "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement