Benutzer mit den meisten Antworten
Wie druckt man Quer und stellt seitenränder ein?

Frage
-
Hallo,
ich drucke in C#, allerdings funktioniert das mit dem Format Quer und die Seiteneinstellungen nicht, der drucker fängt mittig an zu drucken, d.h. die obere hälfte bleibt weiß(Drucker: DYMO LabelWriter 450 Turbo)
Hier mal mein Code:
private void ButDrucken_Click(object sender, EventArgs e) { Datenbankschreiben(); PrintDialog printDialog1 = new PrintDialog(); printDialog1.Document = printDocument1; //printDocument1.PrinterSettings.PrinterName = @"\\br-isd\BR_DRU_TAL"; DialogResult result = printDialog1.ShowDialog(); if (result == DialogResult.OK) { printDialog1.PrinterSettings.DefaultPageSettings.Margins.Top = (int)(1.5/0.0254); //oberer Abstand, geht nicht printDialog1.PrinterSettings.DefaultPageSettings.Landscape = true; //querformat, geht nicht printDocument1.Print(); } MessageBox.Show("Ihr Besucherpass wird gedruckt, bitte melden sie sich am Ende ihres Besuches am Empfang ab.", Box1, MessageBoxButtons.OK, MessageBoxIcon.Information); for (int i = Application.OpenForms.Count - 1; i >= 0; i--) { if (Application.OpenForms[i].Name != "Form1") { Application.OpenForms[i].Close(); } } } private void printDocument1_PrintPage_1(object sender, System.Drawing.Printing.PrintPageEventArgs e) { if (seitennummer == 1) { e.Graphics.DrawString("BESUCHERPASS", new Font("Arial", 13, FontStyle.Regular), Brushes.Black, 8, 3); e.Graphics.DrawString("Name:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 8, 33); e.Graphics.DrawString(textBoxName.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 110, 33); e.Graphics.DrawString("Firmenname:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 8, 60); e.Graphics.DrawString(textBoxFirma.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 110, 60); e.Graphics.DrawString("Begleitpers:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 8, 85); e.Graphics.DrawString(textBoxBesucht.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 110, 85); e.Graphics.DrawString("Beginn:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 8, 110); e.Graphics.DrawString(textBoxBeginn.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 80, 110); e.Graphics.DrawString("Bez:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 190, 110); e.Graphics.DrawString(Beruf, new Font("Arial", 11, FontStyle.Bold), Brushes.Black, 245, 110); e.Graphics.DrawString("Kennz:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 8, 135); e.Graphics.DrawString(textBoxKennz.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 80, 135); e.Graphics.DrawString("Datum:", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 190, 135); e.Graphics.DrawString(textBoxDatum.Text, new Font("Arial", 11, FontStyle.Regular), Brushes.Black, 245, 135); e.Graphics.DrawString("Bitte geben Sie diesen Ausweis nach Gebrauch am Empfang ab.", new Font("Arial", 8, FontStyle.Regular), Brushes.Black, 8, 160); } this.ButDrucken.Click += new System.EventHandler(this.ButDrucken_Click); }
könnt ihr mir hierbei bitte helfen?
mfg
Antworten
-
Hallo Schormi,
schau dir mal folgende Seite an:
http://msdn.microsoft.com/de-de/library/system.drawing.printing.pagesettings.aspx
Im Abschnitt 'Hinweise' stehen ein paar interessante Infos, die Dir evtl. weiterhelfen könnten.
- Als Antwort markiert Robert BreitenhoferModerator Dienstag, 8. November 2011 14:46
Alle Antworten
-
Hallo Schormi,
schau dir mal folgende Seite an:
http://msdn.microsoft.com/de-de/library/system.drawing.printing.pagesettings.aspx
Im Abschnitt 'Hinweise' stehen ein paar interessante Infos, die Dir evtl. weiterhelfen könnten.
- Als Antwort markiert Robert BreitenhoferModerator Dienstag, 8. November 2011 14:46