http://www.perlmonks.org?node_id=1034055

halweitz has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks, I installed and tested wkhtmltopdf from the command line and it works beautifully. Then I installed PDF::WebKit to automate the interaction in a Perl script. However, when I run the script I get this error

: Win32::Process::Create() at C:/Dwimperl/perl/vendor/lib/IPC/Run.pm line 2822

Here is my code

#!perl -w use PDF::WebKit; use File::Slurp qw( :all ) ; my $path = 'C:\\temp\\SPM7L413T7971.htm'; my $html = read_file($path); PDF::WebKit->configure(sub { # default `which wkhtmltopdf` $_->wkhtmltopdf('c:\\Program Files (x86)\\wkhtmltopdf\\'); # default 'pdf-webkit-' # $_->meta_tag_prefix('my-prefix-'); # $_->default_options->{'--orientation'} = 'Portrait'; }); my $kit = PDF::WebKit->new(\$html, page_size=>'Letter'); my $pdf = $kit->to_pdf; my $file = $kit->to_file('c:\\temp\\test2.pdf');

This is mostly a copy and paste from the cpan documentation but I am not sure about the configure subroutine.