in reply to Displaying RTF string to browser

You're just creating an RTF file (file name in $rtfReport). You're not actually doing anything with that file after it's done.

You should print its contents to STDOUT.

Replies are listed 'Best First'.
Re^2: Displaying RTF string to browser
by ikkon (Monk) on Aug 21, 2007 at 17:05 UTC
    I tried
    $fh->close(); print STDOUT $RTF_obj;
    and once the file opens in word I get a error document name or path is not valid
      That's a start. But you're printing the file name, not the file contents.

      Try, hmm... How to make this easy? OK, let's stick to general cross-platform solution: RTF is text, so we'll just print the text of the file to STDOUT line by line.

      open IN, $RTF_obj or die "Oops?"; while(<IN>) { print; }
        ok, tried that, and a few variations, I don't get a error so thats a plus, but I get a blank RTF not sure why though. not to familuar with creating streaming rtf.