Autor Beitrag
Gagamba
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Do 07.07.05 16:38 
[delphi][df][faq][dp] :(

Hallo,
der Print-Befehl eines Forms bringt mir ab und zu (nicht immer, ich habe
auch noch nicht raus gefunden, wann der Effekt auftritt und wann nicht)
statt des Form-Abbilds eine kohlrabenschwarze Seite. Ich benutze
HP Laserjet (verschiedene Serien) und auf allen tritt das hin und
wieder auf, scheint also nicht unbedingt ein Druckerproblem zu sein.
Gibt es eine Alternative für die Form.Print - Methode, die sicherer läuft?

ciao
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Do 07.07.05 17:31 
Willst du etwa das Form Blatt ausdrucken :?:
Dann mache das so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
var bmp: TBitmap;

begin
bmp:=tbitmap.create;
 bmp:=Tgraph.GetFormImage;

printer.Orientation:=polandscape;
printer.Title := ('Mein Form');
  with Printer do
  begin
    BeginDoc;
    // Mit BeginDoc wird ein Druckauftrag initiiert.
    // The StartDoc function starts a print job.
    try
      ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
      ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
      // Informationen über die Auflösung
      // Retrieves information about the Pixels per Inch of the Printer.
      RR := Rect(0, 0, bmp.Width*Scalex, bmp.Height*scaley);
            Canvas.StretchDraw(RR, bmp);
      // An die Auflösung anpassen
      // Stretch to fit

    finally
      EndDoc;   //Methode EndDoc beendet den aktuellen Druckauftrag und schließt die
      // Textdatei-Variable.
      // Steht in finally - um auch bei Abbruch des Druckauftrages Papierausgabe
      // sicherzustellen
    end;
  end;
Gagamba Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Mo 11.07.05 19:22 
Danke,

werd's mal so versuchen, aber es bleibt die Frage,
warum Form.Print die schwarzen Seiten auswirft.
Es wäre mir wirklich 100x lieber, ich fände irgendeine
allgemein gültige Einstellung, die Form.Print zwingt,
"richtig" zu drucken..

Ciao