I'm using FOXIT READER to print a PDF to a network.
When I run the following in command line at DOS prompt
C:\Program Files (x86)\Foxit Software\Foxit Reader>"foxit reader.exe" /t "c:\po222.pdf" "\\CCS-BAR-001\NRG SP 4100N PS"
It works fine
I think this has something to do with there being both a double forward slash and single forward slash in the printer name which C# is failing to recognise even though I am using @ in front of the string to represent the literal string.
My C# code is :
string testFile = "c:\\po222.pdf";
string testPrinter = @"\\CCS-BAR-001\NRG SP 4100N PS";
Process pdfProcess = new Process();
pdfProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
pdfProcess.StartInfo.FileName = @"C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe";
pdfProcess.StartInfo.Arguments = string.Format("/t {0} {1}", testFile, testPrinter);
pdfProcess.StartInfo.CreateNoWindow = false;
pdfProcess.Start();
pdfProcess.CloseMainWindow(); I can't see what I'm doing wrong. Can you spot anything out of place. Any help would be gratefully received. Kind regards
Abdullah ArshadPosted Jul 26, 2012, 1:21 PM
I raise my hat to you sir !!!!
Many many thanks !!!
Abdullah
VulpesPosted Jul 24, 2012, 2:30 PM
Abdullah ArshadPosted Jul 24, 2012, 2:14 PM
Sorry could I ask you one more thing regarding this.
Would I able to achieve attaching @ and quotes around quotes on a printer name (i.e. @"""\\CCS-BAR-001\NRG SP 4100N PS""" ) if that printer name was determned from a data table.
Kind regards.
Abdullah
VulpesPosted Jul 24, 2012, 12:38 PM