AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Drucken auf Plotter mit TPrinter
Thema durchsuchen
Ansicht
Themen-Optionen

Drucken auf Plotter mit TPrinter

Ein Thema von Computerbabalulu · begonnen am 15. Nov 2009 · letzter Beitrag vom 15. Nov 2009
Antwort Antwort
Benutzerbild von Computerbabalulu
Computerbabalulu

Registriert seit: 26. Sep 2003
233 Beiträge
 
#1

Re: Drucken auf Plotter mit TPrinter

  Alt 15. Nov 2009, 21:46
Hat sich erledigt, ich komme wohl nicht drum rum dem Drucker Objekt die Daten zu übergeben.

Wem es interessiert ...

Einstellungen des aktuellen Standartdruckers auslesen...

Delphi-Quellcode:
var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port : array[0..255] of char;
hDMode : THandle;
PDMode : PDEVMODE;
begin
  //Default Printer oder hier mit Printer.PrinterIndex:=xxx einen bestimmten Drucker wählen
  Printer.GetPrinter(Device, Driver, Port, hDMode);
  if hDMode <> 0 then begin
    pDMode := GlobalLock(hDMode);
    if pDMode <> nil then begin
    Memo1.Lines.Add('DmSize : '  + IntToStr(pDMode^.dmSize));
    Memo1.Lines.Add('dmDriverExtra : '  + IntToStr(pDMode^.dmDriverExtra));
    Memo1.Lines.Add('dmFields : '  + IntToStr(pDMode^.dmFields));
    Memo1.Lines.Add('dmOrientation : '  + IntToStr(pDMode^.dmOrientation));
    Memo1.Lines.Add('dmPaperSize : '  + IntToStr(pDMode^.dmPaperSize));
    Memo1.Lines.Add('dmPaperLength : '  + IntToStr(pDMode^.dmPaperLength));
    Memo1.Lines.Add('dmPaperWidth :'  + IntToStr(pDMode^.dmPaperWidth));
    Memo1.Lines.Add('dmScale : '  + IntToStr(pDMode^.dmScale));
    Memo1.Lines.Add('dmCopies : '  + IntToStr(pDMode^.dmCopies));
    Memo1.Lines.Add('dmDefaultSource : '  + IntToStr(pDMode^.dmDefaultSource));
    Memo1.Lines.Add('dmPrintQuality : '  + IntToStr(pDMode^.dmPrintQuality));
    Memo1.Lines.Add('dmColor : '  + IntToStr(pDMode^.dmColor));
    Memo1.Lines.Add('dmDuplex : '  + IntToStr(pDMode^.dmDuplex));
    Memo1.Lines.Add('dmYResolution : '  + IntToStr(pDMode^.dmYResolution));
    Memo1.Lines.Add('dmTTOption : '  + IntToStr(pDMode^.dmTTOption));
    Memo1.Lines.Add('dmCollate : '  + IntToStr(pDMode^.dmCollate));
    Memo1.Lines.Add('dmLogPixels : '  + IntToStr(pDMode^.dmLogPixels));
    Memo1.Lines.Add('dmBitsPerPel : '  + IntToStr(pDMode^.dmBitsPerPel));
    Memo1.Lines.Add('dmPelsWidth : '  + IntToStr(pDMode^.dmPelsWidth));
    Memo1.Lines.Add('dmPelsHeight : '  + IntToStr(pDMode^.dmPelsHeight));
    Memo1.Lines.Add('dmDisplayFlags : '  + IntToStr(pDMode^.dmDisplayFlags));
    Memo1.Lines.Add('dmDisplayFrequency : '  + IntToStr(pDMode^.dmDisplayFrequency));
    Memo1.Lines.Add('dmMediaType : '  + IntToStr(pDMode^.dmMediaType));
    Memo1.Lines.Add('dmDitherType : '  + IntToStr(pDMode^.dmDitherType));
    Memo1.Lines.Add('dmICCManufacturer : '  + IntToStr(pDMode^.dmICCManufacturer));
    Memo1.Lines.Add('dmICCModel : '  + IntToStr(pDMode^.dmICCModel));
    Memo1.Lines.Add('dmPanningWidth : '  + IntToStr(pDMode^.dmPanningWidth));
    Memo1.Lines.Add('dmICMIntent : '  + IntToStr(pDMode^.dmPanningHeight));

    GlobalUnlock(hDMode);
   end;
  end;
end;

Einstellungen des aktuellen Standartdruckers schreiben...

Delphi-Quellcode:
var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port : array[0..255] of char;
hDMode : THandle;
PDMode : PDEVMODE;
begin

   //Default Printer oder hier mit Printer.PrinterIndex:=xxx einen bestimmten Drucker wählen
  Printer.GetPrinter(Device, Driver, Port, hDMode);

  if hDMode <> 0 then
  begin
    pDMode := GlobalLock(hDMode);
    if pDMode <> nil then
    begin
     {Set to custom Settings}
      pDMode^.dmFields := pDMode^.dmFields or
                          DM_PAPERSIZE or
                          DM_SCALE or
                          DM_ORIENTATION or
                          DM_DEFAULTSOURCE or
                          DM_PRINTQUALITY or
                          DM_COLOR or
                          DM_PAPERWIDTH or
                          DM_PAPERLENGTH or
                          DM_MEDIATYPE or
                          DM_DITHERTYPE;

       pDMode^.dmPaperSize := 256;
       pDMode^.dmScale := 100;
       pDMode^.dmOrientation:= 2;
       pDMode^.dmDefaultSource:= 400;
       pDMode^.dmPrintQuality:= 600;
       pDMode^.dmColor:= 2;
       pDMode^.dmPaperWidth := 4320;
       pDMode^.dmPaperLength := 6950;
       pDMode^.dmMediaType:=1;
       pDMode^.dmDitherType:=2;
      GlobalUnlock(hDMode);
    end;
  end;
end;
Gruß Baba
Frank
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:34 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz