I am currently evaluating Spire.PDF for use at my customer site as we need to print PDFs to specific printers, trays and in a specific order and Spire.PDF seems to fit all of that.
In my test code, however I am seeing some strange behavior. I have simple code to pick the 3rd tray to print a PDF document to, however, for some reason it always prints the FIRST page to the main tray, and all of the subsequent pages go to the correct tray.
Any suggestions? Is this a bug? Do I have something coded incorrectly?
To narrow down the issues, when I print from within Acrobat or Word, and select a tray other than the main tray, all of the pages print correctly, so I don't believe it is a printer or driver issue.
The printer I am using is a "Ricoh MP C4603" with the "PCL6 UP" driver.
Thanks!
- Code: Select all
private void button1_Click(object sender, EventArgs e)
{
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument(@"D:\1\a.pdf");
PrinterSettings.PaperSourceCollection collections = doc.PrintDocument.PrinterSettings.PaperSources;
List<Spire.Pdf.PdfPaperSourceTray> loPaperSources = new List<Spire.Pdf.PdfPaperSourceTray>();
Spire.Pdf.PdfPaperSourceTray tray = new Spire.Pdf.PdfPaperSourceTray();
tray.StartPage = 1;
tray.EndPage = doc.Pages.Count;
tray.PrintPaperSource = collections[3];
loPaperSources.Add(tray);
doc.PageSettings.ListPaperSourceTray = loPaperSources;
doc.PrintDocument.Print();
}