Hi weirat,

(on winxp and using MS Word to open the rtf)

I could only get the example from the docs to work if I added an extra number to the widths (but see update2 below).

This of course produced a three column, three row table. The docs show a table with: first row two column, second row three columns and third row two columns.

The underline and the bullet showed fine.

hth

#!/usr/local/bin/perl use strict; use warnings; use RTF::Writer; my $rtf = RTF::Writer->new_to_file("greetings.rtf"); $rtf->prolog( 'title' => "Greetings, hyoomon" ); my $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900, 1500 +]); $rtf->row($decl, "Stuff", "Hmmm"); $rtf->row($decl, [\'\ul', 'Foo'], 'Bar', \'\bullet'); $rtf->row($decl, "Hooboy.");
update:
Forgot to say that it didn't work at all without the $rtf->prolog(...) call.

update2:
A bit more fiddling and the following did reproduce the table shown in the docs

#!/usr/local/bin/perl use strict; use warnings; use RTF::Writer; my $rtf = RTF::Writer->new_to_file("greetings.rtf"); $rtf->prolog( 'title' => "Greetings, hyoomon" ); my $decl; $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900]); $rtf->row($decl, "Stuff", "Hmmm"); $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900,1500]); $rtf->row($decl, [\'\ul', 'Foo'], 'Bar', \'\bullet'); $decl = RTF::Writer::TableRowDecl->new('widths' => [1500,1900]); $rtf->row($decl, "Hooboy.");

In reply to Re: starting RTF Writer by wfsp
in thread starting RTF Writer by weirat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.