simplepos icon indicating copy to clipboard operation
simplepos copied to clipboard

Print PDF file - Imagick cant find file but it exists in supplied folder

Open mountainclimbing opened this issue 7 years ago • 0 comments

Hello,

Am trying the example "print_from_pdf.php"

$pdf = "resources\document.pdf"; $connector = new NetworkPrintConnector("IP Address", 9100); $printer = new Printer($connector); try { $pages = ImagickEscposImage::loadPdf($pdf); foreach ($pages as $page) { $printer -> graphics($page); } $printer -> cut(); } catch (Exception $e) { /*

  • loadPdf() throws exceptions if files or not found, or you don't have the
  • imagick extension to read PDF's */ echo $e -> getMessage() . "\n"; } finally { $printer -> close(); }

I have succesfully installed the imagick extension but I keep receiving the error:

Uncaught exception 'Exception' with message 'exception 'ImagickException' with message 'UnableToOpenBlob `resources\document.pdf': No such file or directory @ error/blob.c/OpenBlob/2702'

Which relates to file not being available but I have the file in said directory/folder. What could I be missing?

Am I suppose to edit anything on "ImagickEscposImage.php" to supply the pdf file?

mountainclimbing avatar Jan 11 '19 17:01 mountainclimbing