I have created a pcl from pdf using aspose.pdf. I want to give tray no in generated pcl file.Is it possible.Please reply
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();
}