在VB.Net中打印格式化的rtf

时间:2015-01-25 19:37:49

标签: vb.net rtf

我得到了Mark Hall的帮助,在VB.Net的图片上打印文字;我用于打印的子目录如下:

  Private Sub printDocument1_PrintPage(ByVal sender As System.Object, ByVal e As  _
  System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    Dim rect1 As Rectangle = New Rectangle(New Point(0, 0), PictureBox1.Image.Size)
    Dim rect2 As Rectangle = New Rectangle(New Point(100, 200), PictureBox1.Image.Size)
    Dim fmt As StringFormat = New StringFormat()
    e.Graphics.DrawImage(PictureBox1.Image, rect1)
    e.Graphics.DrawString(rtfMekdam, RichTextBox1.Font, New SolidBrush(Color.Red), rect2, fmt)
End Sub

显然,代码的最后一行限制了文本的格式化; 现在我创建了一个格式化的RichTextBox(如下所示)并想要如图所示打印它;我无法修改Sub的最后一行来执行此操作;任何帮助赞赏。 enter image description here

如何打印上图所示的格式化rtf;正如我在RichTextBox中所示 -

0 个答案:

没有答案