PHP Class Mike42\Escpos\ImagickEscposImage

Inheritance: extends EscposImage
Show file Open project: mike42/escpos-php Class Usage Examples

Public Methods

Method Description
loadPdf ( string $pdfFile, string $pageWidth = 550 ) : multitype:EscposImage Load a PDF for use on the printer
readImageFromImagick ( Imagick $im ) Load actual image pixels from Imagick object

Protected Methods

Method Description
getColumnFormatFromFile ( string $filename = null, boolean $highDensityVertical = true ) : string[] | null
getRasterFormatFromFile ( string $filename = null ) : string | null
loadImageData ( string $filename = null ) Load an image from disk, into memory, using Imagick.

Private Methods

Method Description
alphaRemove ( Imagick $im ) : Imagick Paste image over white canvas to stip transparency reliably on different versions of ImageMagick.
getColumnFormatFromImage ( Imagick $im, integer $lineHeight ) : string[] Return data in column format as array of slices.
getImageFromFile ( string $filename ) : Imagick Load Imagick file from image
getRasterBlobFromImage ( Imagick $im ) : string Pull blob (from PBM-formatted image only!), and spit out a blob or raster data.

Method Details

getColumnFormatFromFile() protected method

protected getColumnFormatFromFile ( string $filename = null, boolean $highDensityVertical = true ) : string[] | null
$filename string Filename to load from
$highDensityVertical boolean True for high density output (24px lines), false for regular density (8px)
return string[] | null Column format data as array, or NULL if optimised renderer isn't available in this implementation.

getRasterFormatFromFile() protected method

protected getRasterFormatFromFile ( string $filename = null ) : string | null
$filename string Filename to load from
return string | null Raster format data, or NULL if no optimised renderer is available in this implementation.

loadImageData() protected method

Load an image from disk, into memory, using Imagick.
protected loadImageData ( string $filename = null )
$filename string The filename to load from

loadPdf() public static method

Load a PDF for use on the printer
public static loadPdf ( string $pdfFile, string $pageWidth = 550 ) : multitype:EscposImage
$pdfFile string The file to load
$pageWidth string The width, in pixels, of the printer's output. The first page of the PDF will be scaled to approximately fit in this area.
return multitype:EscposImage

readImageFromImagick() public method

Load actual image pixels from Imagick object
public readImageFromImagick ( Imagick $im )
$im Imagick Image to load from