Link to home
Start Free TrialLog in
Avatar of Natavia Finnie
Natavia FinnieFlag for United States of America

asked on

How to use Multi-threading process for printing

I am not very familiar with multi-threading. I need help with multi-threading the ProcessStartInfo for printing to allow my .pdf files that I send to the printer to print in order. I feel that if I use multi-treading that it would allow me to print larger pdf files in the particular order that I need.

Currently was the print jobs get to the printer they tend to print off by size. I have some pretty large pdf file...

I also need to print on one side of paper. The printer is defaulted to double-sided.  I want to print one-sided only for these documents...
For x As Integer = 0 To enclosureList.Count - 1
                Dim psInfo As New ProcessStartInfo

                With psInfo
                    .UseShellExecute = True
                    .Verb = "print"
                    .FileName = enclosureList(x)
                    .WindowStyle = ProcessWindowStyle.Hidden
                    Process.Start(psInfo)
                End With
 Next 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of louisfr
louisfr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Natavia Finnie

ASKER

@louisfr
your code worked as for as building with no errors but the order that it prints is way off. each enclosureList may have anywhere from 2 to 8 pages of enclosures including the attached word file that is a cover sheet that I insert at enclosureList(0) and then the following enclosures should follow.  It is now printing (0) in-between the next enclosureList.

I placed your code at the very end of my print sub...

Should I be calling this sub differently?
Avatar of louisfr
louisfr

I hadn't understood you had that code called on several lists.
It's the whole code which you must put inside the Thread, not just the printing of one list.