Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing method in RTF::HTML::Converter.pm

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
Does anyone have experience of this module?
The following line of code
Code:
my @charmap_data = $_[SELF]->charmap_reader( $_[CONTROL] );
gives the following error
Code:
Can't locate object method "charmap_reader" via package "RTF::HTML::Converter" at RTF/HTML/Converter.pm line 431, <F> line 1.
There is no mention of 'charmap_reader' method in any of the Converter.pm versions I have seen.
I may be looking at this the wrong way as I am not sure what this line is meant to do. The documents just say it works, end of explanation.
Could someone please give me a clue.

Keith
 
Where is the documentation for that module? I don't see it listed on CPAN. I do see RTF::HTMLConverter but it does not list that method in the documentation.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I am new to this module lark so forgive me if I am talking nonsense. After some messing, I managed to get the module to load and received this error when I tried to use it. I looked through the module to find the offending line and found it in this sub, which appears to have no name. I can't say I understand how that works either.
Code:
  sub {
    # RTF: \'<hex value>
    # HTML: &#<dec value>;
    
    my @charmap_data = $_[SELF]->[red]charmap_reader[/red]( $_[CONTROL] );

    my %charset = (		# general rule
		   %charmap_defaults,
				# and some specific defs
		   map({ s/^\s+//; split /\s+/ } @charmap_data)
		  );
    *char = sub { 
      my $char_props;
      if ($START_NEW_PARA) {
	$char_props = $_[SELF]->force_char_props('start');
	$START_NEW_PARA = 0;
      } else {
	$char_props = $_[SELF]->process_char_props();
      }
      output $char_props . $charset{$_[1]}
    } 
  };
From my limited understanding, the offending line is a call to another sub routine within this module called 'charmap_reader'. I too have found no further mention of it hence a question to you guys.

Keith
 
You didn't answer my question.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
coincidentally, I started using rtf2html today and it works fine, but the output is plain text with an related to header and footer (I'm looking into that right now), is that what you are trying to use? If so, I did not get the error listed above.
 
Sorry Kevin - This is the documentation I found.

max1x
I am looking into ways of putting an organisation's newsletter online. They produce a paper version of it, in Word and save it as an .rtf file. I simply want to upload the RTF file to the server and have a perl script format it. This module appeared to be just what I needed but now I am not so sure.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top