I'm trying to print PDF files from my perl script with the following code, but getting the error message "There was an error opening this document. This file cannot be found." I found in some of the forums that any spaces in between the filename could be a problem, but as such I don't have any spaces in filename.
When I'm debugging my program, I'm able to print the PDF file, but when executing I'm getting the above message from Adobe Reader
my $filename = "C:\\Invoices\\foobar.pdf";
my $shellopen = new Win32::API("shell32", "ShellExecute",
['N', 'P', 'P', 'P', 'P', 'I'],
$filename =~ tr!\\!/!s;
$shellopen->Call(0, "print", $filename, 0, 0, 0);