How to set width of generated pdf417 barcode using java

人走茶凉 提交于 2020-01-11 10:19:08

问题


Hi I am working on generating pdf417 barcode. For this I followed this link.

try { 

             String a = "Microsoft";
             String b = "wkejew";
                PDF417 barcode = new PDF417(); 
                barcode.setData(a+b); 

               // barcode.setData(a);

                ServletOutputStream servletoutputstream = response.getOutputStream(); 

                response.setContentType("image/gif"); 
                response.setHeader("Pragma", "no-cache"); 
                response.setHeader("Cache-Control", "no-cache"); 
                response.setDateHeader("Expires", 0); 

                barcode.drawBarcode(servletoutputstream);
 } catch (Exception e) { 
                throw new ServletException(e); 
            }

so now problem is the barcode I am getting is having much width. So can I decrease the width?


回答1:


From your link:

How to Set Generated Barcode PDF-417 Image Width and Height?Top

You can set barcode image width and height through properties barcodeWidth and barcodeHeight values.

Or you can set X (bar module width) and Y (bar module height) values



来源:https://stackoverflow.com/questions/28607547/how-to-set-width-of-generated-pdf417-barcode-using-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!