How to print formatted text - (RTF)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    How to print formatted text - (RTF)

    Hi,

    I have created a print routing that works great for plain text. I have
    some text in Rich Text format that I would like to print as it appears
    with its formatting.

    Does anyone know how to do this? Has someone invented a rich text parser?

    I am thinking right now that to do this the code would have to parse the
    rich text and create DrawString code based on what it found which I can
    then pass to the Graphics object. Is this correct?

    Any help would be greatly appreciated.

    Tim
  • James Curran

    #2
    Re: How to print formatted text - (RTF)

    The method I'd suggest is you stuff the RTF into an RichTextBox control
    and print that. (The RichTextBox need not be attached to a form). Here's
    an article from MSDN which describes (and provided code) to print a
    RichTextBox...




    --
    Truth,
    James Curran
    [erstwhile VC++ MVP]

    Home: www.noveltheory.com Work: www.njtheater.com
    Blog: www.honestillusion.com Day Job: www.partsearch.com
    "Tim" <timc@peopletog o.com> wrote in message
    news:hQ4df.1610 $Tk1.66423@news 20.bellglobal.c om...[color=blue]
    > Hi,
    >
    > I have created a print routing that works great for plain text. I have
    > some text in Rich Text format that I would like to print as it appears
    > with its formatting.
    >
    > Does anyone know how to do this? Has someone invented a rich text parser?
    >
    > I am thinking right now that to do this the code would have to parse the
    > rich text and create DrawString code based on what it found which I can
    > then pass to the Graphics object. Is this correct?
    >
    > Any help would be greatly appreciated.
    >
    > Tim[/color]


    Comment

    Working...