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

HHVM: Cannot load PDF files into EscposImage() #94

Closed
mike42 opened this issue Mar 13, 2016 · 1 comment
Closed

HHVM: Cannot load PDF files into EscposImage() #94

mike42 opened this issue Mar 13, 2016 · 1 comment
Labels

Comments

@mike42
Copy link
Owner

mike42 commented Mar 13, 2016

escpos-php uses file paths in the form foo.php[0] to seek pages from PDF files, and is affected by a compatibility issue between HHVM/Imagick. See facebook/hhvm#4771

The result is that under HHVM, multi-page PDF files cannot be loaded with this driver (EscposIMage::loadPDF will throw Exception: exception 'ImagickException' with message 'Invalid filename provided'). Four tests give errors or fails when loading PDF's in this way.

Affected users can work around the issue limit themselves to singe-page PDF's, or rasterizing their images on the command-line and printing from a series of PNG files.

  • Rasterization can be done with convert.
  • Single-page PDF's can be loaded via new EscposImage("foo.pdf"). A multi-page PDF can be split up into several single-page PDF's with pdftk or qpdf.
@mike42 mike42 added the bug label Mar 13, 2016
@mike42
Copy link
Owner Author

mike42 commented Mar 13, 2016

Attempted removing page-range feature, seems to be other issues with HHVM's Imagick, as the text is now being rasterized over a black background (black page except for images), while other environments render it on white.

See bf0175d - The output of print-from-pdf.php is attached in a zip file for later reference out.zip,

cat out.bin > /dev/usb/lp0

@mike42 mike42 closed this as completed in 4594907 Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant