How to Print Images with a POS Printer: Difference between revisions

From wizarPOS
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images}}")
Tag: Replaced
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* Put image to the assets folder of the application project.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images}}
About the image:
# Image width should less then or equal to 384 dots.
# Image height should be a multiple of 24. If the height is not a multiple of 24, please notice that the remainder dots will print blank.
* Call print image API to print, snippet code(java API) is as follows:
<syntaxhighlight lang="java">
    public void printBitmap(Map<String, Object> param, ActionCallback callback) {
        Bitmap bitmap =null;
        try {
            bitmap = BitmapFactory.decodeStream(mContext.getResources().getAssets()
                    .open("photo.bmp"));
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        try {
            device.printBitmap(bitmap);
            sendSuccessLog(mContext.getString(R.string.operation_succeed));
        } catch (DeviceException e) {
            e.printStackTrace();
            sendFailedLog(mContext.getString(R.string.operation_failed));
        }
    }
</syntaxhighlight >

Latest revision as of 07:41, 7 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/printer/print-images

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!