Autor Beitrag
andre.maus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Do 15.07.04 10:09 
Hallo,

ich möchte den Inhalt eines Memos ausdrucken.

Wie mache ich das?


Gruß,
André
inselberg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458



BeitragVerfasst: Do 15.07.04 11:07 
Suche in: Delphi-Forum, Delphi-Library DRUCKEN
ich mein beim 3. treffer steht schon was - für dich - brauchbares

_________________
hans bist du das ?
andre.maus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Do 15.07.04 12:14 
Danke für den Tip!

Das löst aber nicht ganz mein Problem. Ich weiss wie man ein komplettes Formular druckt. Mir geht es aber darum NUR den Inhalt eines Memos auf Papier zu bringen.
Die print-Funktion lässt ja keine Übergabeparameter zu und Memo1.print klappt nicht....


Gruß,
Andre
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Do 15.07.04 13:35 
Dann eben Suche in: Delphi-Forum, Delphi-Library MEMO DRUCKEN :D

_________________
Gruß
Martin
andre.maus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

winXP
Delphi 7
BeitragVerfasst: Do 15.07.04 19:04 
Super! Danke für die Tips.

Habe aber noch ein Problem. Der Text des Memos wird vom Drucker linksbündig auf die Seite gedruckt (sowie bündig zur Oberkante des Blattes). Quasi direkt an den Rand. Ein Lochen des Blattes ist somit unmöglich. Wie kann ich oben und links ein paar Zentimeter Randabstand schaffen?

Hier mal mein Quelltext:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure DruckeMemo(aMemo:TMemo);
var
  PrnFile: TextFile;
  i:integer;
begin
  AssignPrn(PrnFile);
  Rewrite(PrnFile);
  for i:=0 to aMemo.Lines.Count-1 do Writeln(PrnFile, aMemo.Lines[i]);
  System.CloseFile(PrnFile);
end; // DruckeMemo

procedure TopenForm.Button2Click(Sender: TObject);
begin
  with PrintDialog1 do
    if Execute then DruckeMemo(Memo1);
end;



Vielen Dank schonmal,

Andre Maus
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Do 15.07.04 20:54 
Guck mal wie Delphi selbst seine Units druckt (Datei/Drucken...). Man kann paar Lerzeichen vor jede Zeile einfügen.

Füg also beim Writeln dem Memo String fünf Leerzeichen vor.

_________________
Gruß
Martin