Dear Aspose Team,
I have a requirement of printing PDF file directly from Printer from a specific papersource (Tray). In our end user 's office there are several printers of different make that have multiple trays configured. Already in our exisitng system we have implemented direct print from tray from the respective printers but for that case we first build the pcl and prn files from report tools and then execute print commands from command line. the whole system is automated. But now we have requirement where user is creating the files and stored in a location as a pdf file. During printing they eed the specific PDF file which is created already . So here we need to print directly the PDF file. Now after consulting in different web sites I saw that you have one .Net SDK package to print PDF files. I had used the trial dll however the print has been taken place but not from the specific tray which I had mentioned in the program. After execitng my program with the ASPOSE.PDF dll system do not identify the proper tray. Our printer is HP Laserjet printer having 1 MF and 2 trays i.e. Tray 1 : MF , Tray 2: Middle and Tray 3: Lower. But when I am giving instruction to print from the specific tray system cannot identify the proper tray which I have provided in the program. SO please need your help in this point.
Regards
Jishnu Bhattacharya
MOL-IT India Private Ltd.
@jishnubh
The functionality to specify the papersource (tray) was implemented and working as per expectations in the older version e.g. 23.5. We have recently updated the API and removed the System.Drawing.Printing dependency. After that, the functionality started creating issues. A ticket as PDFNET-56965 has already been logged in our issue management system to address this scenario.
We have linked the ticket with this forum thread so that you will receive a notification as soon as it is resolved. Please be patient and spare us some time.
We are sorry for the inconvenience.
@jishnubh
Beginning with the release 24.8, the RawKind public property will be added to the Aspose.Pdf.Printing.PaperSource class, so that you will be able to set the correct RawKind for the custom paper source.
You can modify your GetPaperSource() method the following way (using the provided ToAsposePaperSource() method to convert the System.Drawing.Printing.PaperSource to its Aspose.PDF analog while retaining the RawKind of the custom paper source):
public static Aspose.Pdf.Printing.PaperSource GetPaperSource(string printerName, string trayName)
{
System.Drawing.Printing.PaperSource ps = null;
System.Drawing.Printing.PrintDocument prtDoc = new System.Drawing.Printing.PrintDocument();
prtDoc.PrinterSettings.PrinterName = printerName;
for (int i = 0; i < prtDoc.PrinterSettings.PaperSources.Count; i++)
{
if (prtDoc.PrinterSettings.PaperSources[i].SourceName.ToLower().Equals(trayName.ToLower()))
{
ps = prtDoc.PrinterSettings.PaperSources[i];
break;
}
}
return ps.ToAsposePaperSource();
}