Text sometimes drops from the print

// Expert user has replied.
T Thomas Birkenes 3 years 7 months ago
2 1 0

For some weird reason it is always the same part missing from the print:
Sometimes Hauler, Driver, Truck etc gets dropped from print.
But the QR code and barcode do not get dropped.
^XA^POI^MNV^LL2200^PW812^LL2300
^LH0,90^FD ^FS^LH0,140^FD ^FS^LH0,170
^FO25,0
^A0,N,25,25
^FDVic Forests - Docket #${weighedDocket.ticketNum}^FS
^LH0,200
^FO25,0^GB812,5,5,B,0^FS^LH0,250^FD ^FS^LH0,280
^FO25,0
^A0,N,25,25
^FD^BY3,3,70^BCN,70,N,N,N^FD${barcode}^FS^FS
^LH0,330^FD ^FS^LH0,380^FD ^FS^LH0,410
^FO25,0
^A0,N,25,25
^FD^FO210,0^FD${barcode}^FS^FS
^LH0,460^FD ^FS^LH0,490
^FO25,0
^A0,N,25,25
^FDDispatched:^FS
^LH0,490
^FO220,0
^A0,N,25,25
^FD${localTimes}^FS
^LH0,520
^FO25,0
^A0,N,25,25
^FDDestination:^FS
^LH0,520
^FO220,0
^A0,N,25,25
^FD${weighedDocket.destinationDesc}^FS
^LH0,570^FD ^FS^LH0,600
^FO25,0
^A0,N,25,25
^FDHarvest Unit:^FS
^LH0,600
^FO220,0
^A0,N,25,25
^FD${weighedDocket.locationDesc}^FS
^LH0,630
^FO25,0
^A0,N,25,25
^FDForest Ops:^FS
^LH0,630
^FO220,0
^A0,N,25,25
^FD${weighedDocket.contractDesc}^FS
^LH0,660
^FO25,0
^A0,N,25,25
^FDContractor:^FS
^LH0,660
^FO220,0
^A0,N,25,25
^FD${weighedDocket.harvestDesc}^FS
^LH0,710^FD ^FS^LH0,740
^FO25,0
^A0,N,25,25
^FDHauler:^FS
^LH0,740
^FO220,0
^A0,N,25,25
^FD${weighedDocket.haulContractorDesc}^FS
^LH0,770
^FO25,0
^A0,N,25,25
^FDDriver:^FS
^LH0,770
^FO220,0
^A0,N,25,25
^FD${weighedDocket.driverName}^FS
^LH0,800
^FO25,0
^A0,N,25,25
^FDTruck Reg:^FS
^LH0,800
^FO220,0
^A0,N,25,25
^FD${weighedDocket.truckDesc}^FS
^LH0,830
^FO25,0
^A0,N,25,25
^FDTrailer Type:^FS
^LH0,830
^FO220,0
^A0,N,25,25
^FD${weighedDocket.trailerType}^FS
^LH0,860
^FO25,0
^A0,N,25,25
^FDLoaded by: ^FS
^LH0,860
^FO220,0
^A0,N,25,25
^FD${weighedDocket.truckLoaderDesc || ''}^FS
^LH0,910^FD ^FS^LH0,940
^FO25,0
^A0,N,25,25
^FDLegal GVM:^FS
^LH0,940
^FO220,0
^A0,N,25,25
^FD${totalLegalGVM} (ton)^FS
^LH0,970
^FO25,0
^A0,N,25,25
^FDScale Weight:^FS
^LH0,970
^FO220,0
^A0,N,25,25
^FD${truckWeightWithLoad} (ton)^FS
^LH0,1010
^FO25,0^GB812,5,5,B,0^FS^LH0,990
^LH0,1020^FD ^FS^LH0,1050
^FO25,0
^A0,N,25,25
^FDSpecies:^FS
^LH0,1050
^FO220,0
^A0,N,25,25
^FD${weighedDocket.productCodeDesc}^FS
^LH0,1080
^FO25,0
^A0,N,25,25
^FDGrade:^FS
^LH0,1080
^FO220,0
^A0,N,25,25
^FD${weighedDocket.productGradeCode}^FS
^LH0,1110
^FO25,0
^A0,N,25,25
^FDNight Load:^FS
^LH0,1110
^FO220,0
^A0,N,25,25
^FD${nightLoad}^FS
^LH0,1140
^FO25,0
^A0,N,25,25
^FDTransit Load:^FS
^LH0,1140
^FO220,0
^A0,N,25,25
^FD${transitLoad}^FS
^LH0,1190^FD ^FS^LH0,1220
^FO25,0
^A0,N,25,25
^FD100% AFS certified^FS
^LH0,1250
^FO25,0
^A0,N,25,25
^FDCertification Number: AFS 703072^FS
^LH0,1350
^A0,N,25,25
^FO25,0
^IME:IMAGE.PNG^FS
^LH0,1580
^FO25,0
^A0,N,25,25
^FDI certify this delivery complies with mass limits^FS
^LH0,1610
^FO25,0
^A0,N,25,25
^FDprescribed by Heavy Vehicle National Law (HVNL)^FS
^LH0,1640
^FO25,0^GB812,5,5,B,0^FS^LH0,1620
^FO25,0
^A0,N,25,25
^LH0,1650^FD ^FS^LH0,1670
^FO25,0
^A0,N,25,25
^FD^BY3,3,70^BCN,70,N,N,N^FD${barcode}^FS^FS
^LH0,1720^FD ^FS^LH0,1830^FD ^FS^LH0,1760
^FO25,0
^A0,N,25,25
^FD^FO210,0^FD${barcode}^FS^FS
^LH0,1820^FD ^FS^LH0,1910^FD ^FS^LH0,1850
^FO25,0^BXN,4,200,,,,\,^FH^FD${compressedDocket}^FS^LH0,1900^FD ^FS^LH0,1930
^XZ^
byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT);
Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
// Instantiate insecure connection for given Bluetooth® MAC Address.
Connection conn = new BluetoothConnectionInsecure(theBtMacAddress);
// Initialize
Looper.prepare();
// Open the connection - physical connection is established here.
conn.open();
ZebraPrinter zprinter = ZebraPrinterFactory.getInstance(conn);
ZebraImageI zi = ZebraImageFactory.getImage(bitmap);
zprinter.storeImage("E:IMAGE.PNG", zi, zi.getWidth(), zi.getHeight());
Thread.sleep(500);
// Send the data to printer as a byte array.
conn.write(zplData.getBytes());
// Make sure the data got to the printer before closing the connection
Thread.sleep(500);
// Close the insecure connection to release resources.
conn.close();
Looper.myLooper().quit();

Please Register or Login to post a reply

1 Replies

S Steven Si

Does this happen all the time? If it happens all the time, then you need to take a look at the ZPL.
What tool do you use to generate the ZPL? There are a lot ^LH commands and ^FD ^FS commands without field values. We only need to use the ^LH once in one ZPL label format. Once we have the label origin is defined at the beginning by ^LH, we only need to use ^FO to specify the field origin for each elements on the label that are relative to ^LH.

CONTACT
Can’t find what you’re looking for?