Hi All,
Am working in Windows Application (.Net , C#). It involves in generating a PDF and printing the PDF. Am able to generate and print the PDF.
For Printing i used following lines of code.
[code]
String file = @"C:\PDFOutput\RegistrationDetail.pdf";
Process p=new Process();
PrinterSettings printer = new PrinterSettings();
obj.PrinterName ="10.11.12.13";
ProcessStartInfo pinfo = new ProcessStartInfo(file);
pinfo.Verb ="PrintTo";
pinfo.CreateNoWindow = true;
pinfo.WindowStyle= ProcessWindowStyle.Hidden;
p.StartInfo =pinfo;
p.Start(); p.close();
[/code]
I need to configure printer (10.11.12.13) as default printer in my dev machine(app server) and then i need to execute the application to work properly. In case i need to change the printer, i need to add the new printer as default printer and then need to execute the process. Is there any alternate way to accomplish this printing without adding as default printer and i can modify the printer dynamically.
thanks in advance.
Regards,
Mahe
Lisa WhitePosted Dec 17, 2015, 9:04 PM
Aaraiz AbhiPosted Dec 17, 2015, 6:04 AM
AcroRd32.exe /t
More information in this post:
http://stackoverflow.com/questions/619158/adobe-reader-command-line-reference
However, I'm not sure if this still works with new versions because it was an unsupported feature in the reader.
If you try it and it doesn't work, you might have to change the approach. Instead of invoking a process to load and print the PDF, use a library like LeadTools to load it in your own code and then print it.
Dhanunjay JajimogglaPosted Dec 8, 2015, 4:55 AM