inserting an image in an RTF file

From: John (john_at_nospam.org)
Date: 09/25/04


Date: Sat, 25 Sep 2004 12:30:01 +0200

Hi all,

I'm generating RTF files on the fly.
Thanks to the msdn rtf spec
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/
html/rtfspec.asp), I could format my rtf.
Still, I can't find the way to display images in the rtf file !
This is what I tried :

$fp = @fopen("logo.jpg", "rb") ;
$ImageContent = @fread($fp, @filesize("logo.jpg") ) ;
echo "{\*\shppict {\pict \jpegblip $ImageContent}}" ;

When I open the rtf file in word I've got an error message : "Memory or not
enough disk space to end the operation".

Do you have any idea/solution ?
Thank you in advance,

--
john


Relevant Pages

  • Re: M$ Word [OT]
    ... RTF file. ... there, save it using OO.o native format, then save it again using .DOC format. ... uncheck and resave the document. ...
    (rec.games.bridge)
  • Uneditable document with no obvious locking
    ... format, and when I opened it I was unable to cut/copy/paste, or for that ... However, when I re-opened the RTF file in Word, I was still unable to access ... this is Microsoft's idea of "protection", it obviously is not very good if ... one can circumvent it by saving the file in another format and opening that ...
    (microsoft.public.mac.office.word)
  • Re: How to construct the RTF format to display text like a hyperlink in RichEdit
    ... > One way to do that is to format the text into RTF format. ... That will have the RTF formatting commands in it. ... by using a word processor to open the .RTF file as text. ...
    (microsoft.public.win32.programmer.ui)
  • Word 2003 format problems
    ... converts it to format "Rich Text Format Document". ... File Convert prompt dialog which used to identify the file as an RTF ... the file using CTRL-S the document gets saves as format "Rich Text ... compatible file into a RTF file, ...
    (microsoft.public.word.conversions)
  • Re: Opening a textedit file on a pc
    ... Dudley Henriques wrote: ... Should I suggest a Windows program to open it and read it or will the PC do it in Word or Word Pad naturally. ... Right now I have the file saved on my MacbookPro desktop as an RTF file. ... This can be opened by any PC app like WordPad, any wersion of Word, etc., It will be a good idea though to compress the file into .zip format before sending it. ...
    (comp.sys.mac.apps)