diff options
Diffstat (limited to 'lib/HTML/AutoConvert/poppler.pm')
-rw-r--r-- | lib/HTML/AutoConvert/poppler.pm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/HTML/AutoConvert/poppler.pm b/lib/HTML/AutoConvert/poppler.pm new file mode 100644 index 0000000..cca5b0d --- /dev/null +++ b/lib/HTML/AutoConvert/poppler.pm @@ -0,0 +1,48 @@ +package HTML::AutoConvert::poppler; + +=head1 NAME + +HTML::AutoConvert::poppler - poppler (pdftohtml) plugin for HTML::AutoConvert + +=head1 URL + +poppler can be downloaded from http://poppler.freedesktop.org/ + +=cut + +use strict; +use vars qw( %info ); +use base 'HTML::AutoConvert::Run'; + +%info = ( + 'types' => 'pdf', + 'weight' => 10, + 'url' => 'http://poppler.freedesktop.org/', +); + +sub program { ( 'pdftohtml', '-stdout' ) } + +#false laziness w/OpenOffice.pm +#sub html_convert { +# my( $self, $file ) = ( shift, shift ); +# my $opt = ref($_[0]) ? shift : { @_ }; +# +# my $program = 'pdftohtml'; +# +# my $timeout = 60; #? +# +# my($out, $err) = ( '', '' ); +# local($SIG{CHLD}) = sub {}; +# run( [ $program, $file ], \undef, \$out, \$err, timeout($timeout) ) +# or die "$program failed with exit status ". ( $? >> 8 ). ": $out\n"; +# +# ( my $outfile = $file ) =~ s/\.pdf$/.html/i +# or die "poppler.pm called with non-PDF file?!"; +# +# my $html = slurp($outfile); +# +# $html; +# +#} + +1; |