Autor Beitrag
Mike_C
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Do 04.03.04 13:32 
Hi

in Sachen Drucken & Co bin ich ein absoluter Noob (Anfänger). Ich hab für meine Frage sie Suchmaschine bemüht, aber nichts wirklich passendes gefunden.

Also folgendes Problem: Ich habe einen Editor, des Syntaxhighlighting unterstützt. Wie kann ich den Text, den ich im Editor geschrieben habe ausdrucken, ohne dabei einen schwarz-weiß Ausdruck zu bekommen? (Also der Drucker soll das Syntaxhighlighting wie in Delphi unterstützen).

Und dann hab ich da noch ne Frage: Wie bekomme ich denn heraus, wieviel Text auf eine Seite passt? Also Zeilen und Spalten?

Greetz
Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
mirage228
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: Do 04.03.04 13:54 
Was für eine Editor komponente benutzt du?

mfG
mirage228

_________________
May the source be with you, stranger.
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Do 04.03.04 14:04 
Ich benutze TSynEdit und einen eigenen Highlighter für die Highlighting-Regeln.

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
mirage228
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 338

Win 7 Prof.
Delphi 2005 Prof., Delphi 2010 Prof.
BeitragVerfasst: Do 04.03.04 14:49 
Achso, dann ist die Sache denkbar einfach.

Du ziehst eine "TSynEditPrint" aufs Formular. Zum Drucken kannst du folgenden Code benutzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  SynEditPrint.SynEdit := SynEdit1; // Das SynEdit zuweisen
  SynEditPrint.Lines.Assign(SynEdit1.Lines); // Den Text zuweisen
  SynEditPrint.DocTitle := 'Titel'; // Ttiel des Dokuments
  SynEditPrint.Highlight := True; // Highlighting anschalten
  SynEditPrint.Copies := 1; // Anzahl Kopien
  SynEditPrint.Highlighter := SynHighglighter1; // Highlighter zuweisen
  SynEditPrint.Print; // Drucken ausführen.


mfG
mirage228

_________________
May the source be with you, stranger.
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Do 04.03.04 15:02 
thx, das ist dann wirklich easy! :D

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?