The above example just creates a text file with a .doc extension. Yes, it can be opened by Word, but it is still just a text file. If you want to have any formatting, etc... you will have to actually create in the Word file format.
PHP supports a certain amount of COM, allowing you to create documents in Microsoft format (
but you need to be running a Windows server. It has nothing to do with PDFlib.
RTF files, though are another thing. I don't think PDFlib supports creating RTF files, but RTF itself is an open format, actually a markup language of its own saved as text. Create an RTF doc in Word, and then examine it in a text editor and you will see.
So... knowing this, you should be able to just get PHP to spit out the appropriate text markup for an RTF document. I'm sure it will be a bit of work, but it wouldn't surprise me if someone out there has already done this and created a library for it. (If not in PHP, for sure in Perl) If someone hasn't done this, then you could contribute nicely to the PHP community by building some classes for RTF file creation.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.