Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mountainclimbing opened this issue Jan 11, 2019 · 0 comments

Comments

@mountainclimbing
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant