Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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.


In reply to Using PDF::WebKit by halweitz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (12)
    As of 2014-09-17 12:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (79 votes), past polls