package com.tgorgics.barcode.util;

import com.tgorgics.barcode.web.dto.BarcodeDTO;

public class BarcodeUtil {

    public static String assembleImagePath(final String servletPath, final BarcodeDTO barcode) {

        final StringBuilder sb = new StringBuilder(servletPath).append("?data=").append(barcode.getData());
        sb.append(barcode.getLabel() == null ? "" : "&label=" + barcode.getLabel());
        sb.append(barcode.isDrawText() == false ? "" : "&drawText=true");
        sb.append(barcode.getWidth() == 0 ? "" : "&width=" + barcode.getWidth());
        sb.append(barcode.getHeight() == 0 ? "" : "&height=" + barcode.getHeight());

        return sb.toString();
    }
}

@@ -365,16 +365,44 @@
  == null
+ %7C%7C barcode.getLabel() == %22%22
  ? %22%22 : 
@@ -678,16 +678,69 @@
 ght());%0D
+%0A        sb.append(%22&headless=false&resolution=-1%22);%0D
 %0A%0D%0A     

fix image path assembler