in reply to Re: Help with WKHTMLTOPDF
in thread Help with WKHTMLTOPDF

Same error even with it reinstalled in the Strawberry directory

#!/usr/bin/perl use strict; use warnings; use WKHTMLTOPDF; my $filename='test.html'; my $path='/temp/'; my $inputfile="$path$filename"; my $outputfilename='test'; my $ext='.pdf'; my $outputfile="$path$outputfilename$ext"; my $pdf = new WKHTMLTOPDF; my $path1='/Strawberry/wkhtmltopdf/bin/'; $pdf->bin_name($path1); $pdf->_input_file('/temp/TEST.html'); $pdf->_output_file('/temp/TEST.pdf'); $pdf->_input_file($inputfile); $pdf->_output_file($outputfile); $pdf->grayscale(1); $pdf->generate; <code> couldn't find command '/Strawberry/wkhtmltopdf/bin/' at C:/Strawberry/ +perl/site/lib/MooseX/Role/Cmd.pm line 117. MooseX::Role::Cmd::run(WKHTMLTOPDF=HASH(0x6d59d0), "/temp/test +.html", "/temp/test.pdf") called at C:/Strawberry/perl/site/lib/WKHTM +LTOPDF.pm line 645 WKHTMLTOPDF::generate(WKHTMLTOPDF=HASH(0x6d59d0)) called at ht +mlpdf.pl line 20

Replies are listed 'Best First'.
Re^3: Help with WKHTMLTOPDF
by kcott (Archbishop) on Dec 08, 2023 at 02:57 UTC
    "couldn't find command '/Strawberry/wkhtmltopdf/bin/' ..."

    In "Re^2: Help with WKHTMLTOPDF" you identified the command as "C:\Strawberry\wkhtmltopdf\bin\wkhtmltopdf". Try using that.

    — Ken

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Help with WKHTMLTOPDF
by LanX (Saint) on Dec 08, 2023 at 02:51 UTC
    > couldn't find command '/Strawberry/wkhtmltopdf/bin/' at C:/Strawberry/perl/...

    Do you see the difference at the start of those two paths?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      From WKHTMLTOPDF: bin_name:

      "Sets the binary executable name for the command you want to run. Defaul is /usr/bin/wkhtmltopdf." [sic]

      The leading C: may or may not be needed. The trailing wkhtmltopdf is definitely needed.

      — Ken