summaryrefslogtreecommitdiff
path: root/lib/HTML/AutoConvert/poppler.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-08-11 07:38:09 +0000
committerivan <ivan>2008-08-11 07:38:09 +0000
commitb5e00dd5534d7f6ec852b537f551bb872931fa04 (patch)
tree3091d93f430e74f823397559d324d7f4ce882f7d /lib/HTML/AutoConvert/poppler.pm
initial importSTART
Diffstat (limited to 'lib/HTML/AutoConvert/poppler.pm')
-rw-r--r--lib/HTML/AutoConvert/poppler.pm48
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;