dcsimg
Results 1 to 4 of 4

Thread: Putting an image in an RTF-file

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    2

    Smile Putting an image in an RTF-file

    So I want to insert a picture from a file into an RTF file. The RTF file is created using this:
    Code:
            Dim w As System.IO.StreamWriter
            w = IO.File.CreateText("OUTPUT")
    I then write to it using w.WriteLine("whatever")

    The thing I want to be able to do, is place an image in the document, and place it on a specific location. I used this resource: http://www.biblioscape.com/rtf15_spec.htm#Heading49, but that didn't clarify anything.

    Thanks in advance,

    Gamer1120

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: Putting an image in an RTF-file

    How is that an RTF file? It's just plain text, isn't it? If you want to create an RTF file the obvious way to do it is to use the RichTextBox control to edit the document and then simply save it to file using the .SaveFile method.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    2

    Re: Putting an image in an RTF-file

    Maybe I should've made myself more clear. I manually add all the tags, for example, and enter is w.writeLine("\par"). I need to manually add w.writeline("\pict..."), but I can't figure out what's after that, on the 3 dots.

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: Putting an image in an RTF-file

    Graphics are stored in an RTF file as binary arrays so, not to put too fine a point on it, you simply can't do it that way (well that's not strictly true but I really can't recommend it so for all intents and purposes you can't). I refer you to my previous answer!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width