#!/usr/bin/perl use strict; use warnings; use HTML::HTMLDoc; my $htmldoc = new HTML::HTMLDoc(); my $filename = $ARGV[0]; print $filename."\n"; #$htmldoc->set_html_content(qq~A PDF file~); $htmldoc->set_input_file($filename); # alternative to use a present file from your fs $htmldoc->set_output_format("pdf14"); $htmldoc->set_charset("iso-8859-1"); $htmldoc->set_compression(1); $htmldoc->links(); $htmldoc->set_pagemode("document"); $htmldoc->set_browserwidth(680); my $pdf = $htmldoc->generate_pdf(); $pdf->to_file('foo.pdf'); print $htmldoc->error();