Delphi 5 - How to Send a FORM FEED Command

I am using Delphi 5 (still) and just finishing off an application.
It would be REALLY useful if I could click on a button to send a Form Feed to the default printer.

Can someone tell me what the correct lines to insert are?
The rest of the reports are, suprisingly, generated by QReports :-).

With thanks,

Ed
LVL 1
edhastedAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bernaniCommented:
bernaniCommented:
edhastedAuthor Commented:
With the formfeed.dpr function I was uncertain how to imbed it into my program and then call it - exuse my naievity.

With the Torry example what happens if it's not LPT1? Is it possible to get it to send to the defualt printer?

Ed
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

quilleyCommented:
uses Printers;

procedure TForm1.btnFormFeedClick(Sender: TObject);
begin
  Printer.BeginDoc;
  Printer.EndDoc;
end;

Quick & dirty, but it works!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edhastedAuthor Commented:
Where does Printer. come from?

Delphi generates unidentfied Identifer when I try this.

There doesn't appear to be a Printer. drop in or am I missing something fundametnal.

Yours,

Ed
edhastedAuthor Commented:
Sorted, put the Printers unit and and prefixed the syntax so it reads:

begin
  Printers.Printer.BeginDoc;
  Printers.Printer.EndDoc;
end;

This is universally simple - sends to the defaul printer and wonderfully short.

This is the quickest and most efficient of the solution provided.

With many thanks,

Ed Hasted
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.