Results 1 to 4 of 4

Thread: [RESOLVED] Duplex printing help plz…

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    Resolved [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!

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,433

    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    5

    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

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,433

    Re: Duplex printing help plz…

    Cool. Don't forget to resolve your thread from the Thread Tools menu.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width