Autor Beitrag
casban
Hält's aus hier
Beiträge: 10

Window 8.1 Professional
C# (VS 2013 Ultimate Edition)
BeitragVerfasst: Mi 05.12.12 13:20 
Hallo Zusammen,

ich möchte gerne einen Text aus einer RTB auddrucken. PrintDialog und document_PrintPage klappt auch. Ich möchte halt gerne eineautomatische Anpassung des Textes an das gewählte Format, sprich
A4,A5 usw..
Wie oder wo kann ich das anpassen?

hier ein bißchen Code
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            SolidBrush pinsel =new SolidBrush(richTextBox1.SelectionColor);
            Font schrift = new Font(richTextBox1.SelectionFont,richTextBox1.SelectionFont.Style);
            e.Graphics.DrawString(richTextBox1.Text , schrift, pinsel, 20,e.MarginBounds.Right,e.MarginBounds.Top);
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            if (printDialog1.ShowDialog()==DialogResult.OK)

            printDocument1.Print();
        }
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 05.12.12 14:21 
Eine Idee wäre vielleicht, alles in ein "genormtes" Bitmap zu zeichnen und das dann skaliert auf die jeweilige Seite zu zeichnen.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".