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;