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

Image Printing issue on imz320 #5

Open
dharmik94 opened this issue Aug 2, 2019 · 2 comments
Open

Image Printing issue on imz320 #5

dharmik94 opened this issue Aug 2, 2019 · 2 comments

Comments

@dharmik94
Copy link

dharmik94 commented Aug 2, 2019

I am trying to print Image from Zebra Print Demo App over Bluetooth, but not printing the same size of an image. Some parts of the Image are cut.
Please check the attached image.

private void printPhotoFromExternal(final Bitmap bitmap) {
        new Thread(new Runnable() {
            public void run() {
                try {
                    getAndSaveSettings();

                    Looper.prepare();
                    helper.showLoadingDialog("Sending image to printer");
                    Connection connection = getZebraPrinterConn();
                    connection.open();
                    ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);



                    if (((CheckBox) findViewById(R.id.checkBox)).isChecked()) {
                        printer.storeImage(printStoragePath.getText().toString(),
                                new ZebraImageAndroid(bitmap),
                                bitmap.getWidth(),
                                bitmap.getHeight());
                    } else {
                        printer.printImage(new ZebraImageAndroid(bitmap),
                                0, 0, bitmap.getWidth(),
                                bitmap.getHeight(),false);
                    }
                    connection.close();

                    if (file != null) {
                        file.delete();
                        file = null;
                    }
                } catch (ConnectionException e) {
                    helper.showErrorDialogOnGuiThread(e.getMessage());
                } catch (ZebraPrinterLanguageUnknownException e) {
                    helper.showErrorDialogOnGuiThread(e.getMessage());
                } catch (ZebraIllegalArgumentException e) {
                    helper.showErrorDialogOnGuiThread(e.getMessage());
                } finally {
                    bitmap.recycle();
                    helper.dismissLoadingDialog();
                    Looper.myLooper().quit();
                }
            }
        }).start();

    }

IMG_1690

@ssizebra
Copy link
Collaborator

ssizebra commented Aug 2, 2019

The image is wider than the width of ZQ320, which is a 3" printer. So a portion of the image top was cut. You need to scale the image to fit the width of the printer. In terms of the cut of the right side of the image, make sure that the setting of the label length on the printer is long enough to cover the entire length of the image. Use the following two commands to check and set the length.

! U1 getvar "zpl.label_length"
! U1 setvar "zpl.label_length" "200"

@nssoftengineer
Copy link

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

3 participants