Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Barcodes

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 27th, 2010, 09:27 AM
dmsawyer dmsawyer is offline
Junior Community Member
 
Join Date: Jun 2009
Location: West Lafayette, IN
Posts: 15
Default Datamatrix 2D Barcode

I am new to Fusion Pro and have not successfully created a Data Matrix Barcode using Fusion Pro. I don't know JS.

Last week some of the codes did not read correctly, most did, during our mailing process. I need more information on how to create a rule for generating this code. I found in Building Blocks, Functions, MakedataMatrixBarcode, "MakeDataMatrixBarcode(DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font));" but I am unsure what information needs to be inserted in the code.

I have watched the "Creating a 2D Barcode" section of the Advanced Features video tutorial but in that tutorial they do not create a Datamatrix 2D Barcode, they create a PDF417 barcode and I can not get the method to work for the Datamatrix code.

Any help with this issue would be greatly appreciated.

I am using FP Desktop 6.0.6.0
Windows XP
Acrobat 8.0 Professional
Reply With Quote
  #2  
Old January 27th, 2010, 03:29 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,638
Default Re: Datamatrix 2D Barcode

All of the parameters to the MakeDataMatrixBarcode function (except, of course, the barcode data in the first parameter) are optional. So, in the simplest case, you can just write the rule like so (with the name of the data field you're using):
Code:
return MakeDataMatrixBarcode(Field("YourDataFieldName"));
You only need to specify the other parameters if you want to override the defaults. In that case, I would use the DataMatrixBarcode object instead so that you can explicitly set whatever property you want. So the simple case becomes:
Code:
var barcodeObj = new DataMatrixBarcode;
return barcodeObj.Make(Field("YourDataFieldName"));
And you can override whatever defaults to need to, like so:
Code:
var barcodeObj = new DataMatrixBarcode;
barcodeObj.pointSize = 4;
barcodeObj.encodingMode = "BASE256";
barcodeObj.preferredFormat = 7;
// etc.
return barcodeObj.Make(Field("YourDataFieldName"));
To see what all the options are, and their default values, look in the Building Blocks dialog, JS Language tab, Objects, DataMatrixBarcode.

You might want to take a look at this thread for some more examples.

As for how to get your barcode scanner to read the barcodes properly, not all scanners handle every variation of the Data Matrix barcode, so you may need to adjust either the scanner's settings or the properties of the DataMatrixBarcode object (or parameters of the MakeDataMatrixBarcode function). Please refer to this site for more information on the Data Matrix barcode specification and variations thereof:
http://www.idautomation.com/datamatrixfaq.html
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old January 28th, 2010, 08:28 AM
dmsawyer dmsawyer is offline
Junior Community Member
 
Join Date: Jun 2009
Location: West Lafayette, IN
Posts: 15
Default Re: Datamatrix 2D Barcode

Thanks for the quick response Dan. I have used the code you sent and ran 100 samples for our mailing department and they matched 100%.

The mailing manager needs to know why the code did not read correctly for our last run so I am attaching the code used, spreadsheet and PDF of the letter. Please let me know if you can tell what went wrong because we need to pin point the error, if it is the code or the scanner.

We have the mailing equipment support team looking at the issue as we, they have taken two of the letters from this run and scanned them in at a different location, here is what they found "Verified the reading of the 2 documents with a handheld scanner this morning. The document 000428 reads correctly. The document that should be 000429 is printed as 0004 4. We will need to figure out why this document is being printed incorrectly. In the meantime we will need to be very careful running read/printegrity jobs as this compromises the integrity of the inserting machine." This is for record sequential number 428 and 429.

The copiers we use are Xerox Nuvera, 100EA Production System Ver. 73.93.43.8.
The mailing equipment is Bowe Bell & Howell using Printegrity and Progressive B & W camera STC - 1100.

Here is the code I used for the 2D data matrix.
// Check treat strings as tagged text
//Replace "data matrix" with name of Field with ""
//Apply Rule as a text field and apply IDAUTOMATIONDMATRIX Font in 4pt

return MakeDataMatrixBarcode (Field("Sequential"), true, "TEXT", "UIC", "4", "NoFontTag", "IDAutomationDMatrix");

Thanks,
Diane
Attached Files
File Type: pdf 157078E.pdf (2.08 MB, 21 views)
Reply With Quote
  #4  
Old January 28th, 2010, 09:52 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,638
Default Re: Datamatrix 2D Barcode

Quote:
Originally Posted by dmsawyer View Post
Thanks for the quick response Dan. I have used the code you sent and ran 100 samples for our mailing department and they matched 100%.

The mailing manager needs to know why the code did not read correctly for our last run so I am attaching the code used, spreadsheet and PDF of the letter. Please let me know if you can tell what went wrong because we need to pin point the error, if it is the code or the scanner.

We have the mailing equipment support team looking at the issue as we, they have taken two of the letters from this run and scanned them in at a different location, here is what they found "Verified the reading of the 2 documents with a handheld scanner this morning. The document 000428 reads correctly. The document that should be 000429 is printed as 0004 4. We will need to figure out why this document is being printed incorrectly. In the meantime we will need to be very careful running read/printegrity jobs as this compromises the integrity of the inserting machine." This is for record sequential number 428 and 429.

The copiers we use are Xerox Nuvera, 100EA Production System Ver. 73.93.43.8.
The mailing equipment is Bowe Bell & Howell using Printegrity and Progressive B & W camera STC - 1100.
I appreciate the information. However, it's not really within the scope of this forum for anyone to sort through a 2500-page output and investigate why a few of the barcodes aren't being handled correctly by your scanner. You may want to contact Support. Also, if you could isolate the problem by just pulling out the couple of pages with the problematic barcodes, that will make it easier to diagnose. In addition, you will need to supply the exact data being passed to the MakeDataMatrixBarcode function corresponding to each of the output barcodes.

That said, without sorting through the whole file, I can tell you a couple of things. First of all, the barcodes are really, really tiny, even at 100 percent magnification. I can easily imagine the scanner having trouble with those; I would suggest trying a point size larger size than four.

Also, the parameters to the MakeDataMatrixBarcode function in your code are not all correct:
Quote:
Originally Posted by dmsawyer View Post
Here is the code I used for the 2D data matrix.
// Check treat strings as tagged text
//Replace "data matrix" with name of Field with ""
//Apply Rule as a text field and apply IDAUTOMATIONDMATRIX Font in 4pt

return MakeDataMatrixBarcode (Field("Sequential"), true, "TEXT", "UIC", "4", "NoFontTag", "IDAutomationDMatrix");
Here is what the placeholders for the function parameters look like when inserted from the Building Blocks:
Code:
MakeDataMatrixBarcode(DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font)
Again, all of the valid values and defaults for these parameters are listed in the Building Blocks dialog, under the JS Language tab, Objects node, DataMatrixBarcode. Let's go over them one at a time:

parameter: your value
------------------------
DataToEncode: Field("Sequential")
This seems to be fine, although you don't specify what the field data is.
ProcessTilde: true
This is okay, as long as the scanner is set to process tildes as well.
EncodingMode: "TEXT"
This is fine, again, as long as the scanner is set to expect this encoding.
PreferredFormat: "UIC"
This is wrong. The parameter should be an integer from 0 to 29, which specifies a format in this table:
http://www.idautomation.com/datamatrixfaq.html#DataMatrix_Formats
I don't know what "UIC" is supposed to mean here. You probably just want to leave this at 0 (zero, the default value) for "automatic."
PointSize: "4"
This is valid, although technically it should be a number (without quotes), not a string. And as I said, you might want something bigger than 4-point. The default is 10 (points); I would just try that.
NoFontTag: "NoFontTag"
This is wrong. It should be a Boolean value, either true or false (without any quotes). I would just omit this parameter and let it default to false so that the correct font tag is generated. The other advantage of this is that you don't need to put the variable for the rule in a non-readable font in the Text Editor.
Font: "IDAutomationDMatrix"
This is fine. It's the default value, so again, I would just omit this.

So, I would change the rule to this:
Code:
return MakeDataMatrixBarcode(Field("Sequential"), true, "TEXT");
// this is the same as:
//return MakeDataMatrixBarcode(Field("Sequential"), true, "TEXT", 0, 10, false, "IDAutomationDMatrix");
Or even just this:
Code:
return MakeDataMatrixBarcode(Field("Sequential"));
// this is the same as:
//return MakeDataMatrixBarcode(Field("Sequential"), false, "ASCII", 0, 10,  false, "IDAutomationDMatrix");
And I'll bet that your scanner is likely to handle the barcode with all the default options.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});

Last edited by Dan Korn; January 28th, 2010 at 09:58 AM.. Reason: Added equivalents with all parameters to the suggested syntax at the end.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.