Frequently Asked Question:
How do I get a list of the available paper trays for the selected printer?
How do I get a list of the available paper trays for the selected printer?
In order to get a list of the available paper trays for a printer you need to use the GetPrinterBins function. This function will return a list of the available paper trays and associated values. You can then use the returned value with the SetupCustomPrinter function to print your documents to the relevant paper tray.
Some example Delphi code demonstrating how to do this is shown here:
procedure TForm2.btnGetPrinterBinsClick(Sender: TObject);
var
PrinterName: String;
Bins: String;
begin
PDFLibrary := TQuickPDF0715.Create;
try
UnlockResult := PDFLibrary.UnlockKey('...');
if UnlockResult = 1 then
begin
PrinterName := PDFLibrary.GetDefaultPrinterName();
Bins := PDFLibrary.GetPrinterBins(PrinterName);
ShowMessage(Bins);
end;
finally
PDFLibrary.Free;
end;
end;