Closed mountainclimbing closed 5 years ago
@mountainclimbing - the stack trace includes 'PDFDelegateFailed', which indicates that your ImageMagick setup is not able to process PDF files. This is not an escpos-php
issue, and should be solved through other channels.
Aside, your printer does not understand the ESC/POS language that this library produces, and will print garbage. See "I have a printer that does not understand ESC/POS. Can I use this driver?" in the FAQ.
I had the same problem, garbage print every time, but I changed $printer -> graphics() for $printer -> bitImage() and it works
I had the same problem, garbage print every time, but I changed $printer -> graphics() for $printer -> bitImage() and it works
Did that, and no more garbage, but POS printing like old impact printer. How to speed it up?
Hello, Am looking at the example, "print-from-pdf.php'. ---------php start-------- require(DIR . '..\vendor\autoload.php'); use Mike42\Escpos\Printer; use Mike42\Escpos\ImagickEscposImage; use Mike42\Escpos\PrintConnectors\NetworkPrintConnector; use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
$pdf = "document.pdf"; $connector = new WindowsPrintConnector("HP DeskJet 1011 series"); $printer = new Printer($connector); try { $pages = ImagickEscposImage::loadPdf($pdf); foreach ($pages as $page) { $printer -> graphics($page); } $printer -> cut(); } catch (Exception $e) { /*
imagick extension to read PDF's */ echo $e -> getMessage() . "\n"; } finally { $printer -> close(); } ----------php end--------
I have installed imagick and everything else but I keep getting this error:
"exception 'ImagickException' with message 'PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/801' in C:\wamp\www\print\vendor\mike42\escpos-php\src\Mike42\Escpos\ImagickEscposImage.php:228 Stack trace: #0 C:\wamp\www\print\vendor\mike42\escpos-php\src\Mike42\Escpos\ImagickEscposImage.php(228): Imagick->readimage('C:\wamp\www\pri...') #1 C:\wamp\www\print\example\print-from-pdf.php(24): Mike42\Escpos\ImagickEscposImage::loadPdf('C:\wamp\www\pri...') #2 {main} "
What are I missing?