/** * Print an image, using the older "bit image" command. This creates padding on the right of the image, * if its width is not divisible by 8. * * Should only be used if your printer does not support the graphics() command. * * @param EscposImage $img The image to print * @param EscposImage $size Size modifier for the image. */ function bitImage(EscposImage $img, $size = self::IMG_DEFAULT) { self::validateInteger($size, 0, 3, __FUNCTION__); $header = self::dataHeader(array($img->getWidthBytes(), $img->getHeight()), true); $this->connector->write(self::GS . "v0" . chr($size) . $header); $this->connector->write($img->toRasterFormat()); }