Hi,
I’m not able to print a given pdf document by using a specific paper source.
I have tried several things:
- PrintDocumentWithSettings(printerSettings);
- PrintDocumentWithSettings(pageSettings, printerSettings);
- Attached to PdfQueryPageSettings event and set papersource
Nothing helped, the tray is never used. When I print the file using Acrobat, everything works fine.
We are using a Kyocera TASKalfa 2552ci KX printer.
This is the test code:
var file = @"C:\Temp\testfile.pdf";
document = new Aspose.Pdf.Document(file);
var viewer = new PdfViewer(document);
var printers = System.Drawing.Printing.PrinterSettings.InstalledPrinters;
var ps = viewer.GetDefaultPrinterSettings();
ps.PrinterName = printers[6];
ps.FromPage = 1;
ps.ToPage = 1;
ps.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
var pageSetting = new System.Drawing.Printing.PageSettings();
for (int index = 0; index < ps.PaperSources.Count; index++)
{
if (ps.PaperSources[index].SourceName == "Kassette 2")
{
pageSetting.PaperSource = ps.PaperSources[index];
ps.DefaultPageSettings.PaperSource = pageSetting.PaperSource;
break;
}
}
viewer.PrintDocumentWithSettings(pageSetting, ps);
viewer.Close();
From my point of view the code is correct. Could the reason be a printer driver problem?
Thanks in advance.
Regards,