in reply to Help with WKHTMLTOPDF

G'day justin423,

"couldn't find command '/usr/bin/wkhtmltopdf' at ..."

The documentation for WKHTMLTOPDF shows /usr/bin/wkhtmltopdf as the default. You appear to be on an MSWin system so it's unlikely that path would exist. It provides a bin_name to change that. I'd suggest starting there.

You've also got a whole swag of other issues that I recommend you address. Here's a few that stand out; there could well be others.

— Ken

Replies are listed 'Best First'.
Re^2: Help with WKHTMLTOPDF
by eyepopslikeamosquito (Archbishop) on Dec 08, 2023 at 00:53 UTC

    You've also got a whole swag of other issues that I recommend you address ... strict and warnings ...

    Though I hope to be proved wrong, based on the op's most recent question pattern matching once (see also my reply), I don't like our chances of seeing these glaring issues addressed.

    👁️🍾👍🦟
Re^2: Help with WKHTMLTOPDF
by justin423 (Scribe) on Dec 08, 2023 at 01:52 UTC

    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
      "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.
      > 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