473,231 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Creating rtf file with php

EJ
I would like to creat an rtf document with a php script - has anyone seen it
done?
Jul 17 '05 #1
10 12459
"EJ" <ej*******@uq.net.au> a écrit dans le message news:
40********@news.comindico.com.au...
I would like to creat an rtf document with a php script - has anyone seen it done?


found this :
http://www.bitfolge.de/rsscreator-en.html

--
pomho
Jul 17 '05 #2
With total disregard for any kind of safety measures "pomho"
<po***@nospam.org> leapt forth and uttered:
"EJ" <ej*******@uq.net.au> a écrit dans le message news:
40********@news.comindico.com.au...
found this :
http://www.bitfolge.de/rsscreator-en.html

--
pomho


Thats *RTF* not *RSS*. He wants to create a Rich Text Document.

Rich-text is a text-based format. So if you're reasonably good with
PHP theres no reaosn why you wouldn't be able to generate an RTF
format just by reading the RTF specification.

Try it for yourself, create a simple file using Wordpad, then open
the rtf file using an ASCII text editor.
--
Phil Roberts | Dork Pretending To Be Hard | http://www.flatnet.net/
Jul 17 '05 #3
EJ
Thanks but can that be used to create an rtf document (ie rich text format
doc). I have only seen doc files produced on win servers using a com module.
I am trying to use a linux server - I have used an excel class that
generated a spreadsheet output - I was wondering if the same could be done
with word or rtf as substitute for word.

"pomho" <po***@nospam.org> wrote in message
news:40*********************@news.free.fr...
"EJ" <ej*******@uq.net.au> a écrit dans le message news:
40********@news.comindico.com.au...
I would like to creat an rtf document with a php script - has anyone
seen it
done?


found this :
http://www.bitfolge.de/rsscreator-en.html

--
pomho

Jul 17 '05 #4
EJ
Phil
I have trouble I think with the ascii format - I have tried for example to
cut and paste the rtf headers from editpad lite into a php variable but
there is some kind of problem - I just get the headers appearing in my rtf
document.

"Phil Roberts" <ph*****@HOLYflatnetSHIT.net> wrote in message
news:Xn*************************@216.196.97.132...
With total disregard for any kind of safety measures "pomho"
<po***@nospam.org> leapt forth and uttered:
"EJ" <ej*******@uq.net.au> a écrit dans le message news:
40********@news.comindico.com.au...
found this :
http://www.bitfolge.de/rsscreator-en.html

--
pomho


Thats *RTF* not *RSS*. He wants to create a Rich Text Document.

Rich-text is a text-based format. So if you're reasonably good with
PHP theres no reaosn why you wouldn't be able to generate an RTF
format just by reading the RTF specification.

Try it for yourself, create a simple file using Wordpad, then open
the rtf file using an ASCII text editor.
--
Phil Roberts | Dork Pretending To Be Hard | http://www.flatnet.net/

Jul 17 '05 #5

"EJ" <ej*******@uq.net.au> wrote in message
news:40******@news.comindico.com.au...
Phil
I have trouble I think with the ascii format - I have tried for example to
cut and paste the rtf headers from editpad lite into a php variable but
there is some kind of problem - I just get the headers appearing in my rtf
document.


Post a sample?

Garp
Jul 17 '05 #6
EJ
This is what I was trying

<?php
header("Content-type: text/rtf");
header("Content-Disposition: attachment; filename=overdue.rtf");

$dataText = <<<EOD
\{\rtf1\ansi\ansicpg1252\uc1
\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\from an\fcharset0\fprq2{\*\pano
se 02020603050405020304}Times New Roman;}{\f28\froman\fcharset238\fprq2
Times New Roman CE;}{\f29\froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f31\froman\fcharset161\fprq2 Times New Roman
Greek;}{\f32\froman\fcharset162\fprq2 Times New Roman
Tur;}{\f33\froman\fcharset177\fprq2 Times New Roman
(Hebrew);}{\f34\froman\fcharset178\fprq2 Times New Roman (Arabic);}
{\f35\froman\fcharset186\fprq2 Times New Roman
Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green 0\blue255;\red0\green255\b
lue255;\red0\green255\blue0;\red255\green0\blue255 ;\red255\green0\blue0;\red
255\green255\blue0;\red255\green255\blue255;
\red0\green0\blue128;\red0\green128\blue128;\red0\ green128\blue0;\red128\gre
en0\blue128;\red128\green0\blue0;\red128\green128\ blue0;\red128\green128\blu
e128;\red192\green192\blue192;}{\stylesheet{
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustri ght\rin0\lin0\itap0
\fs24\lang3081\langfe1033\cgrid\langnp3081\langfen p1033 \snext0
Normal;}{\*\cs10 \additive Default Paragraph Font;}}{\info{\title This is an
rtf document}{\author Eamon Hannan}
{\operator Eamon
Hannan}{\creatim\yr2004\mo3\dy21\hr21\min30}{\revt im\yr2004\mo3\dy21\hr21\mi
n30}{\version1}{\edmins0}{\nofpages1}{\nofwords0}{ \nofchars0}{\*\company
CMC}{\nofcharsws0}{\vern8247}}\paperw11906\paperh1 6838
\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noul trlspc\dntblnsbdb\nospacef
orul\formshade\horzdoc\dgmargin\dghspace180\dgvspa ce180\dghorigin1800\dgvori
gin1440\dghshow1\dgvshow1
\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrf oot\splytwnine\ftnlytwnine
\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalc tblwd\lyttblrtgr\lnbrkrule
\fet0\sectd
\linex0\headery708\footery708\colsx708\endnhere\se ctlinegrid360\sectdefaultc
l
{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\ pntxta .}}{\*\pnseclvl2\pn
ucltr\pnstart1\pnindent720\pnhang{\pntxta
..}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhan g{\pntxta
..}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnh ang{\pntxta )}}{\*\pnseclvl
5
\pndec\pnstart1\pnindent720\pnhang{\pntxtb
(}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnha ng{\pntxtb
(}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhan g{\pntxtb
(}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnha ng
{\pntxtb
(}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhan g{\pntxtb
(}{\pntxta )}}\pard\plain \ql
\li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustri ght\rin0\lin0\itap0
\fs24\lang3081\langfe1033\cgrid\langnp3081\langfen p1033 {
This is an rtf document.
\par }\}
EOD;

echo $dataText;

?>

"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:jX***********************@news-text.cableinet.net...

"EJ" <ej*******@uq.net.au> wrote in message
news:40******@news.comindico.com.au...
Phil
I have trouble I think with the ascii format - I have tried for example to cut and paste the rtf headers from editpad lite into a php variable but
there is some kind of problem - I just get the headers appearing in my rtf document.


Post a sample?

Garp

Jul 17 '05 #7
Oops, replied by email. Here it is again.
This is what I was trying

<?php
header("Content-type: text/rtf");
header("Content-Disposition: attachment; filename=overdue.rtf");

$dataText = <<<EOD
\{\rtf1\ansi\ansicpg1252\uc1
\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\from an\fcharset0\fprq2{\*\pano se 02020603050405020304}Times New Roman;}{\f28\froman\fcharset238\fprq2
<snip>
\fs24\lang3081\langfe1033\cgrid\langnp3081\langfen p1033 {
This is an rtf document.
\par }\}
EOD;

echo $dataText;

?>


Your enemy here is whitespace - using the <<</EOD form is injecting spaces
where the linebreaks are, and they're poison to RTF.

I'd suggest you put the original RTF template into a text file and
substitute the text you want changed with scalar variables:
{\author $author}

Garp
Jul 17 '05 #8
EJ
Thanks Garp
I think I have it now - read a file and do string replaces etc - I have it
working now.
EJ

"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:1K***********************@news-text.cableinet.net...
Oops, replied by email. Here it is again.
This is what I was trying

<?php
header("Content-type: text/rtf");
header("Content-Disposition: attachment; filename=overdue.rtf");

$dataText = <<<EOD
\{\rtf1\ansi\ansicpg1252\uc1

\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\from an\fcharset0\fprq2{\*\pano
se 02020603050405020304}Times New Roman;}{\f28\froman\fcharset238\fprq2


<snip>
\fs24\lang3081\langfe1033\cgrid\langnp3081\langfen p1033 {
This is an rtf document.
\par }\}
EOD;

echo $dataText;

?>


Your enemy here is whitespace - using the <<</EOD form is injecting spaces
where the linebreaks are, and they're poison to RTF.

I'd suggest you put the original RTF template into a text file and
substitute the text you want changed with scalar variables:
{\author $author}

Garp

Jul 17 '05 #9
"EJ" <ej*******@uq.net.au> a écrit dans le message news:
40******@news.comindico.com.au...
Thanks but can that be used to create an rtf document (ie rich text format
doc). I have only seen doc files produced on win servers using a com module. I am trying to use a linux server - I have used an excel class that
generated a spreadsheet output - I was wondering if the same could be done
with word or rtf as substitute for word.


ok, I thought RSS & RTF were the same.

--
pomho
Jul 17 '05 #10
Can I know how to do this?

I have a form and would like the results to be send in rtf as an
attachment in an email.
Regards,
Jet

"EJ" <ej*******@uq.net.au> wrote in message news:<40********@news.comindico.com.au>...
Thanks Garp
I think I have it now - read a file and do string replaces etc - I have it
working now.
EJ

"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:1K***********************@news-text.cableinet.net...
Oops, replied by email. Here it is again.
This is what I was trying

<?php
header("Content-type: text/rtf");
header("Content-Disposition: attachment; filename=overdue.rtf");

$dataText = <<<EOD
\{\rtf1\ansi\ansicpg1252\uc1

\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\from an\fcharset0\fprq2{\*\pano
se 02020603050405020304}Times New Roman;}{\f28\froman\fcharset238\fprq2


<snip>
\fs24\lang3081\langfe1033\cgrid\langnp3081\langfen p1033 {
This is an rtf document.
\par }\}
EOD;

echo $dataText;

?>


Your enemy here is whitespace - using the <<</EOD form is injecting spaces
where the linebreaks are, and they're poison to RTF.

I'd suggest you put the original RTF template into a text file and
substitute the text you want changed with scalar variables:
{\author $author}

Garp

Jul 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeremy Langworthy | last post by:
Hi I am trying to create a MS Excel format CSV but I can't figure out how to get the line feed/carriage return/new record working properly. I am nding each line/record with these characters:...
1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
1
by: dave | last post by:
I first started using HCW.exe to compile .rtf filew created with MS Word a couple of weeks ago. I used the file | new menu then selected New project in the dialog box and everything worked as...
1
by: C-man | last post by:
Basically I have this little program that will look through directories and rename any file it finds. The renaming that takes place is like removing of dashes or Caps the first letter from each...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
1
by: MT | last post by:
We have a .NET dll that we are deploying to our customers using a deployment project in VS .NET 2003. There is a lot of information about creating publisher policies on the web, but we have not...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.