Hello all,
I have the followning printroutine which works fine - but howto enhance it to allow the choice of a specific paper tray number? Thanks for any advice.
Code
procedure PrintPDF(APrinterIndex: Integer; AFileName: String; APrintTitle: String);
var
vForm: TForm;
vWpViewPDF: TWPViewPDF;
begin
vForm := TForm.Create(nil);
vForm.Visible := False;
vWpViewPDF := TWPViewPDF.Create(vForm);
vWpViewPDF.Parent := vForm;
try
vWpViewPDF.filename := AFileName;
vWpViewPDF.CommandStr(COMPDF_SetPrintTitle, APrintTitle);
vWpViewPDF.command(COMPDF_SetPagePaperBin, 39);
vWPViewPDF.BeginPrint(Printer.Printers[APrinterIndex]);
vWPViewPDF.PrintPages(1, vWpViewPDF.PageCount);
vWPViewPDF.EndPrint;
finally
FreeAndNil(vWpViewPDF);
FreeAndNil(vForm);
end;
end;
Alles anzeigen
Best regards
Michael Eriksen