Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a form which I need the user to be able to print but I only want a certain region of the form printed. Is there a way I can select a certain region (without the user having to) and only print that?

What I have tried:

procedure TForm1.Button1Click(Sender: TObject);
var
  printDialog : TPrintDialog;
  myPrinter   : TPrinter;
begin
printDialog := TPrintDialog.Create(Form1);
if printDialog.Execute then
  begin
    Printer.Orientation := poLandscape;    
    Form1.PrintScale:=poPrintToFit;        

    Form1.Print;

  end;
end;
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900