Compare commits

..

No commits in common. "f619001e5f1ab6e49b4d391ec585cf6eed5ad280" and "9869e3c9c0a3296966c369fe82e07ce8512e5986" have entirely different histories.

3 changed files with 43 additions and 14 deletions

View File

@ -7,7 +7,7 @@ public enum BarcodeStickerSize {
SIZE_4_X_4( 4 * 72, 4 * 72, 8, 8, 8, 8, 200, 100, 250, 250, 14, 9, 7),
SIZE_1_75_X_3_5( 3.5f * 72, 1.75f * 72, 10, 10, 6, 6, 50, 50, 125, 125, 14, 9, 7),
SIZE_4_X_7( 7f * 72, 4f * 72, 200, 10, 40, 6, 50, 40, 125, 125, 14, 9, 7),
SIZE_1_X_2( 67.69f, 128.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
SIZE_1_X_2( 67.69f, 125.73f ,10 , 10, 20, 6, 60, 60, 125, 125, 4, 9, 7);
private final float width;
private final float height;

View File

@ -217,10 +217,6 @@ public class BarcodeService {
String concatenatedIds = bundles.stream()
.map(bundle -> String.valueOf(bundle.getId()))
.collect(Collectors.joining("\\"));
int totalWrappedQuantity = bundles.stream()
.mapToInt(e->e.getWrapQuantity().intValue())
.sum();
this.drawCenteredText(g2d, "Total-Pieces: " + totalWrappedQuantity, detailFont, x, y, pageWidth, cols, stickerSize.getMarginTop() + 270, stickerSize.getMarginLeft());
this.drawCenteredText(g2d, "Sub-Bundles: " + concatenatedIds, detailFont, x, y, pageWidth, cols, stickerSize.getMarginTop() + 290, stickerSize.getMarginLeft());
}
@ -287,6 +283,7 @@ public class BarcodeService {
g2d.drawString(text, adjustedX, adjustedY);
}
public void getBarcodeImagesForStitchItems(List<? extends InventoryArtifact> artifacts,
BarcodeStickerSize stickerSize) throws Exception {
@ -312,7 +309,7 @@ public class BarcodeService {
float qrY =stickerSize.getMarginLeft()+50 ;
float qrX = stickerSize.getMarginTop();
qrCodeImage.setFixedPosition(qrX - 16, qrY-40);
qrCodeImage.setFixedPosition(qrX - 16, qrY-47);
document.add(qrCodeImage);
float textX = stickerSize.getMarginLeft() + 40;
@ -325,7 +322,7 @@ public class BarcodeService {
int maxLength = 14;
List<String> lines = new ArrayList<>();
for (int i = 0; i < 5; i++) {
for (int i = 0; i < 3; i++) {
int start = i * maxLength;
if (start < combinedText.length()) {
String part = combinedText.substring(start, Math.min(start + maxLength, combinedText.length())).replaceAll("\\s+", "");
@ -335,7 +332,7 @@ public class BarcodeService {
float labelWidth = 67.69f;
float textBoxWidth = 220;
float textY1 = textY-23;
float textY1 = textY-30;
float textXCenter = textX + (labelWidth / 2) - (textBoxWidth / 2)-50;
for (String line : lines) {
@ -353,13 +350,13 @@ public class BarcodeService {
String id = String.valueOf(artifact.getId());
document.add(new Paragraph(id)
.setFont(font)
.setBold()
.setFontColor(ColorConstants.BLACK)
.setBold()
.setFontSize(stickerSize.getTextSize() + 8)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(textX - 25, textY + 13, 100));
.setFixedPosition(textX - 25, textY + 8, 140));
float dottedLine = textY - 65;
float dottedLine = textY - 60;
for(int i= 0 ;i<16;i++){
document.add(new Paragraph("|")
.setFontSize(stickerSize.getTextSize())
@ -367,12 +364,12 @@ public class BarcodeService {
.setBold()
.setRotationAngle(-Math.PI / 2)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(dottedLine,textX+45, 100));
.setFixedPosition(dottedLine,textX+40, 100));
dottedLine += 7;
}
float dottedLine2 = textY - 65;
float dottedLine2 = textY - 60;
for(int i= 0 ;i<16;i++){
document.add(new Paragraph("|")
.setFontSize(stickerSize.getTextSize())
@ -380,7 +377,7 @@ public class BarcodeService {
.setBold()
.setRotationAngle(-Math.PI / 2)
.setTextAlignment(TextAlignment.LEFT)
.setFixedPosition(dottedLine2,textX+80, 100));
.setFixedPosition(dottedLine2,textX+75, 100));
dottedLine2 += 7;
}
@ -433,9 +430,38 @@ public class BarcodeService {
public void printLabel(BufferedImage bufferedImage) throws Exception {
Connection connection = new TcpConnection(ipAddress, port);
connection.open();
ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
//Reset Printer Settings
String resetSettings = "^XA^JUS^XZ";
printer.sendCommand(resetSettings);
//Force Label Length & Disable Auto Feed
String lengthFix = "^XA^LL555^PON^XZ"; // **Reduce Length (880) & Disable Auto Feed
printer.sendCommand(lengthFix);
//Apply New Settings
String settings = "^XA" +
"^MMT" + // Continuous Mode
"^MTT" + // Thermal Transfer Mode
"^LH0,0" + // Home Position
"^PR6" + // Print Speed (~120mm/sec)
"^MD25" + // Darkness Level
"^PW541" + // Label Width (67.69mm for 203 DPI)
"^LL550" + // Reduced Label Length (fix gap)
"^PN0" + // No Extra Page Feed
"^PON" + // Disable Printer's Auto Feed Mode
"^XZ";
printer.sendCommand(settings);
// Convert BufferedImage to ZebraImage
ZebraImage zebraImage = new ZebraImage(bufferedImage);
// Print image
printer.printImage(zebraImage, 0, 0, 0, 0, false);
connection.close();
}
}

View File

@ -3445,6 +3445,9 @@ if ( typeof Vue !== 'undefined' ) {
},
filter : {
default : true
},
inputMode: {
default : 'none'
}
}
})