.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "EBook::Tools::EReader 3pm" .TH EBook::Tools::EReader 3pm "2019-08-08" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" EBook::Tools::EReader \- Palm::PDB handler for manipulating the Fictionwise/PeanutPress eReader format. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& use EBook::Tools::EReader; \& my $pdb = EBook::Tools::EReader\->new(); \& $pdb\->Load(\*(Aqmyfile\-er.pdb\*(Aq); \& print "Loaded \*(Aq",$pdb\->{title},"\*(Aq by ",$pdb\->{author},"\en"; \& my $html = $pdb\->html; \& my $pml = $pdb\->pml \& $pdb\->write_unknown_records .Ve .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" .IP "\(bu" 4 \&\f(CW\*(C`Compress::Zlib\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`Image::Size\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`P5\-Palm\*(C'\fR .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .ie n .SS """new()""" .el .SS "\f(CWnew()\fP" .IX Subsection "new()" Instantiates a new Ebook::Tools::EReader object. .SH "ACCESSOR METHODS" .IX Header "ACCESSOR METHODS" .ie n .SS """filebase""" .el .SS "\f(CWfilebase\fP" .IX Subsection "filebase" In scalar context, this is the basename of the object attribute \&\f(CW\*(C`filename\*(C'\fR. In list context, it actually returns the basename, directory, and extension as per \f(CW\*(C`fileparse\*(C'\fR from File::Basename. .ie n .SS """footnotes()""" .el .SS "\f(CWfootnotes()\fP" .IX Subsection "footnotes()" Returns a hash containing all of the footnotes found in the file, where the keys are the footnote ids and the values contain the footnote text. .ie n .SS """footnotes_pml()""" .el .SS "\f(CWfootnotes_pml()\fP" .IX Subsection "footnotes_pml()" Returns a string containing all of the footnotes in a form suitable to append to the end of \s-1PML\s0 text output. This is called as part of \&\*(L"\fBpml()\fR\*(R". .ie n .SS """footnotes_html()""" .el .SS "\f(CWfootnotes_html()\fP" .IX Subsection "footnotes_html()" Returns a string containing all of the footnotes in a form suitable to append to the end of \s-1HTML\s0 text output. This is called as part of \&\*(L"\fBhtml()\fR\*(R". .ie n .SS """pml()""" .el .SS "\f(CWpml()\fP" .IX Subsection "pml()" Returns a string containing the entire original document text in its original encoding, including all sidebars and footnotes. .ie n .SS """html()""" .el .SS "\f(CWhtml()\fP" .IX Subsection "html()" Returns a string containing the entire document text (including all sidebars and footnotes) converted to \s-1HTML.\s0 .PP Note that the \s-1PML\s0 text is stored in the object (and thus retrieving it is very fast), but generating the \s-1HTML\s0 output requires that the text be converted every time this method is used, consuming extra processing time. .ie n .SS """sidebars()""" .el .SS "\f(CWsidebars()\fP" .IX Subsection "sidebars()" Returns a hash containing all of the sidebars found in the file, where the keys are the sidebar ids and the values contain the sidebar text. .ie n .SS """sidebars_pml()""" .el .SS "\f(CWsidebars_pml()\fP" .IX Subsection "sidebars_pml()" Returns a string containing all of the sidebars in a form suitable to append to the end of \s-1PML\s0 text output. This is called as part of \&\*(L"\fBpml()\fR\*(R". .ie n .SS """sidebars_html()""" .el .SS "\f(CWsidebars_html()\fP" .IX Subsection "sidebars_html()" Returns a string containing all of the sidebars in a form suitable to append to the end of \s-1HTML\s0 text output. This is called as part of \&\*(L"\fBhtml()\fR\*(R". .ie n .SS """write_html($filename)""" .el .SS "\f(CWwrite_html($filename)\fP" .IX Subsection "write_html($filename)" Writes the raw book text to disk in \s-1PML\s0 form (including all sidebars and footnotes) with the given filename. .PP If \f(CW$filename\fR is not specified, writes to \f(CW\*(C`$self\->filebase\*(C'\fR with a \*(L".html\*(R" extension. .PP Returns the filename used on success, or undef if there was no text to write. .ie n .SS """write_images()""" .el .SS "\f(CWwrite_images()\fP" .IX Subsection "write_images()" Writes each image record to the disk. .PP Returns a list containing the filenames of all images written, or undef if none were found. .ie n .SS """write_pml($filename)""" .el .SS "\f(CWwrite_pml($filename)\fP" .IX Subsection "write_pml($filename)" Writes the raw book text to disk in \s-1PML\s0 form (including all sidebars and footnotes) with the given filename. .PP If \f(CW$filename\fR is not specified, writes to \f(CW\*(C`$self\->filebase\*(C'\fR with a \*(L".pml\*(R" extension. .PP Returns the filename used on success, or undef if there was no text to write. .ie n .SS """write_unknown_records()""" .el .SS "\f(CWwrite_unknown_records()\fP" .IX Subsection "write_unknown_records()" Writes each unidentified record to disk with a filename in the format of \&'raw\-record\-####', where #### is the record number (not the record \s-1ID\s0). .PP Returns the number of records written. .SH "MODIFIER METHODS" .IX Header "MODIFIER METHODS" .ie n .SS """Load($filename)""" .el .SS "\f(CWLoad($filename)\fP" .IX Subsection "Load($filename)" Sets \f(CW\*(C`$self\->{filename}\*(C'\fR and then loads and parses the file specified by \f(CW$filename\fR, calling \*(L"ParseRecord(%record)\*(R" on every record found. .ie n .SS """ParseRecord(%record)""" .el .SS "\f(CWParseRecord(%record)\fP" .IX Subsection "ParseRecord(%record)" Parses \s-1PDB\s0 records, updating the object attributes. This method is called automatically on every database record during \f(CW\*(C`Load()\*(C'\fR. .ie n .SS """ParseRecord0($data)""" .el .SS "\f(CWParseRecord0($data)\fP" .IX Subsection "ParseRecord0($data)" Parses the header record and places the parsed values into the hashref \&\f(CW\*(C`$self\->{header}\*(C'\fR. .PP Returns the hash (not the hashref). .SH "PROCEDURES" .IX Header "PROCEDURES" .ie n .SS """cp1252_to_pml()""" .el .SS "\f(CWcp1252_to_pml()\fP" .IX Subsection "cp1252_to_pml()" An unfinished and completely nonfunctional procedure to convert Windows\-1252 characters to \s-1PML\s0 \ea codes. .PP \&\s-1DO NOT USE.\s0 .ie n .SS """pml_to_html($text,$filebase)""" .el .SS "\f(CWpml_to_html($text,$filebase)\fP" .IX Subsection "pml_to_html($text,$filebase)" Takes as input a text string in Windows\-1252 encoding containing \s-1PML\s0 markup codes and returns a string with those codes converted to \s-1UTF\-8 HTML.\s0 .PP Requires a second argument \f(CW$filebase\fR to specify the basename of the file (or specifically, the basename of the file to which output text will be written) so that image links can be generated correctly. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" .IP "\(bu" 4 \&\s-1HTML\s0 conversion doesn't handle handle the \eT command used to indent. .IP "\(bu" 4 \&\s-1HTML\s0 conversion may be suboptimal in many ways. .Sp Most notably, most linebreaks are handled as
, and without any heed to whether those linebreaks occur inside of some other element. Validation is extremely unlikely. .SH "AUTHOR" .IX Header "AUTHOR" Zed Pobre .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2008 Zed Pobre .PP Licensed to the public under the terms of the \s-1GNU GPL,\s0 version 2