[RESOLVED] Duplex printing help plz…
Hi, I want to print bulk PDF files from C# or VB.Net code. I have written the below snippet to do the same.
DirectoryInfo dir =
new DirectoryInfo(folderPath);
//create an array of files using FileInfo object
FileInfo [] files;
//get all files for the current directory
files = dir.GetFiles("*.*");
//iterate through the directory and print the files
foreach (FileInfo file in files)
{
ShellExecute(0, "print", file.FullName, "", "", 1);
}
return true;
}
catch(Exception ex)
{
return bReturnLog;
}
Now my problem is I want to print on of the file in duplex mode (both sides). So how can I send the instructions to the printer to print this file in duplex mode and I want to change setting back to print other files in single side. Could you plz advice me or give me the code snippet to resolve this Issue. Thanks!
Re: Duplex printing help plz…
The PrinterSettings class has a Duplex property, although I'm not sure whether that will have an effect outside your app or not. That would be the place to start looking though. The other possibility that definitely would affect outside apps would be to use WMI. There's a Win32_PrinterConfiguration class that has a Duplex property. You should read about the System.Management namespace to get information about using WMI in .NET apps.
Re: Duplex printing help plz…
I have implemented the functionality using the below link. Previously i got the error because of drivers Issue. Now it is working.
http://support.microsoft.com/default...NoWebContent=1
Re: Duplex printing help plz…
Cool. Don't forget to resolve your thread from the Thread Tools menu.