Autor Beitrag
LokutusvB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

WinXP
Delphi 5, Delphi XE
BeitragVerfasst: Mo 24.01.11 12:13 
Guten Morgen,

ich habe mir ein Formular mit einer TPrintPreview erstellt. Mit Hilfe des TPrinterSetupDlg drucke ich die Seiten aus. Was ich bisher nicht hinbekommen habe, ist die Ermittlung der Anzahl der tatsächlich gedruckten Seiten. Denn im DruckerDlg kann ich beliebig viele Kopien einstellen. Kann ich das für mein Formular irgendwie temporär deaktivieren oder kann ich die Anzahl der tatsächlich gedruckten Seiten ermitteln?
LokutusvB Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

WinXP
Delphi 5, Delphi XE
BeitragVerfasst: Do 27.01.11 14:54 
Da es so nicht möglich ist, wollte ich das ganze ohne den Windows-Druck-Dialog eröffnen.

Dafür lese ich die Drucker aus und fülle damit eine Combobox. Vor dem Druck setzte ich den PrinterIndex. Aber egal, welchen Drucker ich wähle, die TPrintPreview druckt immer auf den Standard-Drucker. Wo liegt der Fehler?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
DruckVS.PrintJobTitle := 'Druck_' + IntToStr(AtgNr);
//SysPrinter.PrinterIndex := cbPrinter.ItemIndex;
SysPrinter.PrinterIndex := SysPrinter.Printers.IndexOf(cbPrinter.Text);
DruckVS.SetPrinterOptions;
DruckVS.UpdateAnnotation;
DruckVS.Print;

DruckVS ist vom Typ TPrintpreview
SysPrinter ist vom Typ TPrinter
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Do 27.01.11 15:23 
einfach Printer.PrinterIndex nicht SysPrinter.PrinterIndex setzen?

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS
LokutusvB Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

WinXP
Delphi 5, Delphi XE
BeitragVerfasst: Do 27.01.11 15:26 
Wenn nur alles so einfach wäre. Ich danke dir! :)