NAME

Palm::Doc - Handler for Palm Doc books

SYNOPSIS

use Palm::Doc;

DESCRIPTION

Helper for reading Palm Doc books. The interface is based on Palm::ZText since it just makes sense. However, because of the nature of these databases, record-level processing is just a Bad Idea. Use the text and textfile calls rather than do direct access of the @records array.

EXAMPLES

Convert a text file to a .pdb:

use Palm::Doc;
my $doc = new Palm::Doc;
$doc->textfile( $ARGV[0] );
$doc->Write( $ARGV[0] . ".pdb" );

Convert an HTML file to a .prc:

use HTML::TreeBuilder;
use HTML::FormatText;
use Palm::Doc;

my $tree = HTML::TreeBuilder->new_from_file( $ARGV[0] );
my $formatter = HTML::FormatText->new( leftmargin => 0, rightmargin => 80 );
my $doc = new Palm::Doc;
$doc->{attributes}{resource} = 1;
$doc->text( $formatter->format( $tree ) );
$doc->Write( $ARGV[0] . ".prc" );

new

$doc = new Palm::Doc;

Create a new Doc object. By default, it's not a resource database. Setting $self-{attributes}{resource}> to 1 before any manipulations will cause it to become a resource database.

text

$text = $doc->text;

Return the contents of the Doc database.

$text = $doc->text( @text );

Set the contents of the Doc book to the specified arguments. All the list arguments will simply be concatenated together.

textfile

$doc->textfile( "README.txt" );

Set the contents of the Doc to the contents of the file and sets the name of the PDB to the specified filename.

BUGS

Bookmarks are unsupported. I've never had any use for them.

Output databases are always compressed and there's no option to disable compression. I consider this a feature, to be honest.

AUTHOR

Christophe Beauregard <cpb@cpan.org>

SEE ALSO

Palm::PDB(3)

Palm::StdAppInfo(3)

makedoc

http://www.pyrite.org/doc_format.html

http://patb.dyndns.org/Programming/PilotDoc.htm

Palm::PalmDoc(3) is another CPAN module for handling Doc databases, but doesn't use Palm::PDB and doesn't handle reading Docs.