|
Posted by GooderThanYou on 09/28/76 11:45
If I create a new blank word document, save it as a RTF and open it in
text editor... I can paste this code in it:
{\rtf\ansi\deff0{\fonttbl{\f0\froman Tms Rmn;}{\f1\fdecor
Symbol;}{\f2\fswiss Helv;}}
{\trowd
\trbrdrt\brdrs\brdrw10
\trbrdrl\brdrs\brdrw10
\trbrdrb\brdrs\brdrw10
\trbrdrr\brdrs\brdrw10
\trbrdrh\brdrs\brdrw10
\trbrdrv\brdrs\brdrw10
\clbrdrt\brdrs\brdrw10
\clbrdrl\brdrs\brdrw10
\clbrdrb\brdrs\brdrw10
\clbrdrr\brdrs\brdrw10
\intbl \cellx1 \cell \row }
\par}
which when I open it I get a blank table that is at least there.
In PHP, if I open a blank RTF or an existing RTF and place the code in
there the table keeps shifting up and down over and over and glitching
all over the place. Here is my PHP code of opening a RTF template and
replacing one of the key words with the table code:
header('Content-type: application/msword');
header('Content-Disposition: inline; filename=test.rtf');
$file = 'RCTPWORD.rtf';
$fp = fopen ($file, 'r');
$output = fread( $fp, filesize($file));
fclose($fp);
$rctp5 =
"
{\rtf\ansi\deff0{\fonttbl{\f0\froman Tms Rmn;}{\f1\fdecor
Symbol;}{\f2\fswiss Helv;}}
{\trowd
\trbrdrt\brdrs\brdrw10
\trbrdrl\brdrs\brdrw10
\trbrdrb\brdrs\brdrw10
\trbrdrr\brdrs\brdrw10
\trbrdrh\brdrs\brdrw10
\trbrdrv\brdrs\brdrw10
\clbrdrt\brdrs\brdrw10
\clbrdrl\brdrs\brdrw10
\clbrdrb\brdrs\brdrw10
\clbrdrr\brdrs\brdrw10
\intbl \cellx1 \cell \row }
\par}
";
$output = str_replace( '<<eductable>>', $rctp5, $output);
echo $output;
Everything is fine excep the <<eductable>> which is a table but jumping
all over like I said before.... Does anyone know what I'm trying to
accomplish and can help?
Thanks!
Navigation:
[Reply to this message]
|