Selecting paper source

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF PrintManager for .NET (v1)  /  Re: Selecting paper source

DynamicPDF PrintManager for .NET (v1) Forum

 Oct 10 2012 10:07 AM
We need to print using different paper sources. Our current software does that when printing Crystal Reports and Word documents by specifying System.Drawing.Printing.PaperSource.RawKind (the numeric property of a paper tray).
How can I use the same numeric code with PrintManager? All priters we use have 5 paper trays, all of them are used.
 Oct 10 2012 12:54 PM
Posted by a ceTe Software moderator
Hello,

You  can set the paper source to the print job using the paper source name. You will need to use the SetPaperSourceByName method of PrintOptions class to do this. Also you can use the PaprerSource class and PaperSources enumerator to set the paper source for the printjob. Below is the sample code for it.

Method 1: Setting paper source using static PaperSource class.
  
            InputPdf pdf = new InputPdf(@"C:\MyDocument.pdf");
            Printer printer = new Printer("PrinterName");
            PrintJob printjob = new PrintJob(printer,pdf);
            //Setting paper source using PaperSource class.
            PaperSource paperSource= printer.PaperSources.Automatic;
            printjob.PrintOptions.PaperSource = paperSource;
            printjob.Print();

Method2:Setting Paper source using the paper source name.

            InputPdf pdf = new InputPdf(@"C:\My Document.pdf");
            Printer printer = new Printer("PrinterName ");
            PrintJob printjob = new PrintJob(printer,pdf);
            PaperSourceList list = printer.PaperSources;
            for (int i = 0; i < list.Count; i++)
            {
                Console.WriteLine("PaperSource " + list[i].Name);
            }
            //Setting paper source using the name of the tray.
            printjob.PrintOptions.SetPaperSourceByName("Drawer 2");
            printjob.Print();
            Console.Read();

Thanks,
ceTe Software Support Team.
 Oct 11 2012 6:22 AM
Hello,
It is workable.
Still, it's a pity that you don't support numeric tray codes: the codes always remain the same in any OS and driver language, while tray names don't. For example, in English it is "Tray 3", while in Dutch it's "Lade 3".
 Oct 11 2012 12:20 PM
Posted by a ceTe Software moderator
Hello,

Our development team has discussed about this feature and they are planning to add this in the upcoming v2 release. If you would like to BETA test it please send an email to support@cete.com so we can notify you when the v2 BETA release is ready.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 6:33 AM.