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

Unnecessary space from top of the barcode slip #16

Open
amanItdose opened this issue Aug 19, 2022 · 3 comments
Open

Unnecessary space from top of the barcode slip #16

amanItdose opened this issue Aug 19, 2022 · 3 comments

Comments

@amanItdose
Copy link

While printing the lines over barcode slips
we are getting unnecessary margin or space from the top.

"! 0 200 200 210 1" + "\r\n"//set the height of the bitmap and the quantity to print
+ "TONE 50" + "\r\n"//print intensity tone 0-200
// + "CENTER" + "\r\n"//print speed (less = more accurate) 1 2.5cm/s | 2 - 5cm/s | 3 - 7.6cm/s*/
+ "TEXT 7 0 0 100 " + firstLine.toStrin
cpcl_issue
g() + "\r\n"
+ "COUNT 1"+ "\r\n"//print speed (less = more accurate) 1 2.5cm/s | 2 - 5cm/s | 3 - 7.6cm/s
+ "TEXT 7 0 0 100 " + barcode + "\r\n"
+ "COUNT -10" + "\r\n"
+ "B 128 1 1 50 20 66 " + barcode + "\r\n"
+ "COUNT -10" + "\r\n"//get the image we stored before in the printer
+ "TEXT 7 0 0 100 " + secondLine.toString() + "\r\n"
+ "COUNT -10"+ "\r\n"//get the image we stored before in the printer
+ "TEXT 7 0 0 100 " + thirdLine.toString() + "\r\n"
+ "COUNT -10"+ "\r\n"//get the image we stored before in the printer
+ "TEXT 7 0 100 " + fourthLine.toString() + "\r\n"//get the image we stored before in the printer

                                    + "FORM" + "\r\n"
                                    + "PRINT" + "\r\n";//print
@ssizebra
Copy link
Collaborator

It looks like an alignment issue. Please refer to this CPCL Manual for the details of the commands used in the label format script.

@NeerajItdose
Copy link

NeerajItdose commented Aug 21, 2022

surely I go through this CPCL document, but i am not getting actual result yet.
as I am getting extra spacing between two prints

Connection connection = new BluetoothConnection(viewModel.preference.getPrinterMacAddress());
connection.open();
String printString = "! 0 350 200 200 1" + "\r\n"
                             + "TONE 50" + "\r\n"
                             + "TEXT 7 0 10 20 " + firstLine.toString() + "\r\n"
                             + "B 128 1 1 50 10 46 " + barcode + "\r\n"
                             + "TEXT 7 0 10 100 " + barcode + "\r\n" 
                             + "TEXT 7 0 10 120  " + secondLine.toString() + "\r\n"
                             + "TEXT 7 0 10 140 " + thirdLine.toString() + "\r\n" 
                             + "FORM" + "\r\n"
                             + "PRINT" + "\r\n";//print
connection.write("! U1 JOURNAL\r\n! U1 SETFF 50 2\r\n".getBytes());
connection.write(printString.getBytes());
connection.close();

cpcl_printing_issue

@amanItdose
Copy link
Author

amanItdose commented Aug 21, 2022

Along with the above
I also tried with below code, but not getting correct alignment

printer model - Zebra ZQ120

Connection connection = new BluetoothConnection(viewModel.preference.getPrinterMacAddress());
connection.open();
String printString = "! 0 200 200 210 3 \r\n"
+ "TONE 100 \r\n"
+ "CENTER \r\n"
+ "! U1 JOURNAL\r\n"
+ "! U1 XY 0 10\r\n"
+ "TEXT 7 0 20 20 " + firstLine + "\r\n"
+ "B 128 1 1 50 20 46 " + barcode + "\r\n"
+ "TEXT 7 0 20 100 " + barcode + "\r\n"
+ "TEXT 7 0 20 120 " + secondLine + "\r\n"
+ "TEXT 7 0 20 140 " + thirdLine + "\r\n"
+ "! U1 SETFF 0 0 \r\n"
"FORM \r\n"
+ "PRINT \r\n";
connection.write(printString.getBytes());
connection.close();
print_align_issue

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