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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using PDF::WebKit
by Anonymous Monk on May 18, 2013 at 08:41 UTC | |
Re: Using PDF::WebKit
by Anneq (Vicar) on May 18, 2013 at 18:33 UTC | |
by halweitz (Novice) on May 18, 2013 at 23:06 UTC |
Back to
Seekers of Perl Wisdom