New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

How to calculate the size of a printed PDF417 barcode

Hello support,
We are working on a project to move Adobe AEM form with PDF417 Barcode to HTML5 using the PDF417 JavaScript Barcode Generator and convert HTML5 into PDF with 300 dpi A4 size. We also tried to get some information on PDF417 Barcode in AEM form as Ecclevel 6, module height/width 2, module width 0.0338cm, and summarized some properties of PDF417 barcode JS function as:

IDAutomation_JavaScriptBarcode_PDF417(
bcodevalue,
1,//'ApplyTilde': 1,
6,//'EccLevel': 8,
20,//'ColumnSpecify': 0,
0,//'RowSpecify': 0,
0,//'Truncate': 0,
1,//'ForceBinary': 0,
3,//'XYRatio': 0,
4,//'XDimensionPoints': 4,
3,//'ReturnType': 4,
3//'QuietZone': 3
);

Some properties need to be verified as follows:

1.XDimensionPoints= 4, for 300 dpi, it will be suggested to set 4 pix (0.0338 cm).
2. EccLevel 6, same as Adobe.
3.ColumnSpecify = 20, PDF417 Barcode will contain 20 columns, and total barcode width will be 11.492 cm(20*4*0.0338).
4.RowSpecify =0, it will grow automatically according to the input data.
5.XYRatio=3, Adobe set 2, but 3 will be better or not?
5.ReturnType = 3. Will you suggest changing the ReturnType value and getting a better quality of PDF417 Barcode?

regards !!


Mason Pai 06-08-2025


06-07-25     82 day(s) ago    

  Report Abuse

 

Brant

Best Answer

Referring to the User Manual for the JavaScript Barcode Generator, the ReturnType of "1" will return a BMP image, and that should allow you to adjust it to 4 pixels if needed by setting XDimensionPoints to 4. The XYRatio setting of 2 is difficult for many scanners to read, so we recommend using 3, which is the default. However, if a specification calls for 2, then use 2.

The difference in the barcode output is because each ReturnType functions differently, and that is why we offer several different options. ColumnSpecify allows you to specify the number of data columns. The start and stop patterns combined with the row indicators consume 4 columns of 17 modules plus 2 extra columns in the final stop pattern. To calculate the complete width of the symbol, use X * (((Data Columns + 4) * 17) +2); for example, if X is 3 pixels and you have 5 data columns, then 3 * (((5 + 4) * 17) +2) = 465 pixels. The result may also change depending on your implementation, and you also need a quiet zone to the right and left of the symbol. For more information about this, refer to the PDF417 Wiki page.

Posted 78 day(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (3)
Hello support,

After we reviewed your comments, I think I have a clear understanding of how to calculate barcode width.

We have tried to create two HTML pages using the PDF417 JavaScript function with different properties to check the barcode size.

Based on the table width of 19cm, ColumnSpecify 20, we have tested two different properties to see how barcode mapping works with the table.

We can see div size in table is 715 * 158 and calculate barcode width as ( 20 +4 )*17 + 2 + 6 = 416X

We tried to set ReturnType = 1, XDimensionPoints = 715 / 416 = 1.7, and see barcode image will be mapped with the div size.

We tried to set ReturnType = 3 XDimensionPoints = 4.5 ( trial and error ), see pre style size 741 * 157 including barcode and space.

Based on these two different settings, we are considering using ReturnType = 1/0 ( barcode image ) for HTML barcode design.

regards !!


Mason Pai 06-13-2025

Posted 76 day(s) ago

(0)
(0)
   Report Abuse
Hello support,
We have tried to set ReturnType = 1 and XDimensionPoints = 4, and the barcode size will be 1656* 372. refer barcodeHtml_bmp01
If we set ReturnType = 3 and XDimensionPoints = 4 and barcode size will be 674*176.refer barcodeHtml_font01
Can you explain why it will have two different barcode outputs?
As to the barcodeHtml_font01 sample, the properties are set as :
IDAutomation_JavaScriptBarcode_PDF417(
bcodevalue,

1, //'ApplyTilde': 1,
6, //'EccLevel': 8,
20, //'ColumnSpecify': 0,
0, //'RowSpecify': 0,
0, //'Truncate': 0,
1, //'ForceBinary': 0,
3, //'XYRatio': 0,
4, //'XDimensionPoints': 4,
3, //'ReturnType': 4,
3 //'QuietZone': 3 )
Based on these properties, we can try to calculate the width point of the barcode font as follows:
'ColumnSpecify': 20,'XDimensionPoints': 4, one character 11x, total width will be 20 * 11 * 4 = 880, but actual barcode width is 674, can you help to explain ColumnSpecify meaning?

thanks !!

Mason Pai 06-11-2025

Posted 78 day(s) ago

(0)
(0)
   Report Abuse
Setting the ECC level to 6 will help a little; however, PDF417 is not a good barcode type for faxing because there are multiple widths of the bar in the barcode. If you can choose a different barcode type, we recommend Data Matrix or QR Code for faxing. When setting XDimensionPoints=4 and ReturnType=1, the result is a BMP image where X is equal to 4 pixels, and this should give you better quality. I recommend trying out a few different settings to see what is best for your implementation.

Posted 80 day(s) ago

(0)
(0)
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook