Quantcast

Jump to content

» «
Photo

Delphi 7 - Print

No replies to this topic
gtadani1
  • gtadani1

    Crackhead

  • Members
  • Joined: 13 Aug 2011

#1

Posted 19 March 2013 - 09:31 PM

Hi.
I'm working on a program on Delphi 7, but now I have one thing that I can't do. confused.gif
I have this components on my program:
Memo1
PageSetup1 -> Opens PageSetupDialog1
Print1 --------> Opens PrintDialog1 to select your printer and print your text in Memo1.

There is one part of my program's source (I think this helps).

CODE
procedure TForm1.PageSetup1Click(Sender: TObject);
begin
PageSetupDialog1.Execute;
end;

procedure TForm1.Print1Click(Sender: TObject);
begin
if PrintDialog1.Execute
then Printer.BeginDoc;
FontH := Printer.Canvas.TextHeight(Memo1.Lines[0]);
Printer.Canvas.TextOut((Printer.PageWidth div 2)-(Printer.Canvas.TextWidth(Memo1.Lines[0]) div 2),0,Memo1.Lines[0]);
for Loop := 1
to Memo1.Lines.Count-1
do Printer.Canvas.TextOut(0,Loop*FontH,Memo1.Lines[Loop]);
Printer.EndDoc;
end;


PageSetup, configures your document's page to print, but when I will print one document (like Adobe PDF), the text will print with no configuration (no borders, no page size,...) and my question is:
There's a way that I can print one document with PageSetup1Dialog's configuration?

Thanks. cool.gif
I hope you can help me.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users