AWhite2504 Posted December 2, 2019 Share Posted December 2, 2019 Hello, I need to create a 2D barcode using DataMatrix that will be read by cameras on our inserter. The barcode will need to enlist: Job #:***XX Example:00001 Record #:****** Example:000001 Member ID:******X Example:1234567 Page #:***X Example 01,02,03 Example: 00001000001123456701 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 2, 2019 Share Posted December 2, 2019 Something like this: var data = FormatNumber("00000", Field("Job #")); data += FormatNumber("000000", FusionPro.Composition.inputRecordNumber); data += FormatNumber("0000000", Field("Member ID")); data += FormatNumber("00", FusionPro.Composition.currentPageNumber); return MakeDataMatrixBarcode(data); Make sure to check both "Treat returned strings as tagged text" and "Re-evaluate this rule for every text flow". Quote Link to comment Share on other sites More sharing options...
AWhite2504 Posted December 3, 2019 Author Share Posted December 3, 2019 Perfect! Is it possible to decrease the size of the bar code? Quote Link to comment Share on other sites More sharing options...
AWhite2504 Posted December 3, 2019 Author Share Posted December 3, 2019 Preferably these dimensions: pointSize = 6; preferredFormat = 48; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 3, 2019 Share Posted December 3, 2019 Preferably these dimensions: pointSize = 6; preferredFormat = 48; There's no format 48. You probably want format 13, which yields 48X48. The formats are listed here: https://www.barcodefaq.com/2d/data-matrix/#DataMatrix_Formats Though generally, if you don't specify the format, the barcode will be made as small as possible, so specifying a format may actually make it larger. Anyway, change the last line to something like: return MakeDataMatrixBarcode(data, 0, 0, 13, 6); Or: var DM = new DataMatrixBarcode; DM.pointSize = 6; DM.preferredFormat = 13; return DM.Make(data); Quote Link to comment Share on other sites More sharing options...
AWhite2504 Posted January 6, 2020 Author Share Posted January 6, 2020 Dan, Instead of using page number I need sheet number. Is this possible? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 6, 2020 Share Posted January 6, 2020 Dan, Instead of using page number I need sheet number. Is this possible? Sure, use FusionPro.Composition.impositionSheetNumber. See: http://forums.pti.com/showpost.php?p=13793&postcount=3 I imagine you'll also probably want to use the custom imposition sheet background feature, to place the barcode once on the imposed sheet, rather than on each page on the sheet. See the section "Imposition Background Sheet" section in the Rules Guide, and: http://forums.pti.com/showpost.php?p=11530&postcount=3 Quote Link to comment Share on other sites More sharing options...
AWhite2504 Posted January 6, 2020 Author Share Posted January 6, 2020 When using the FusionPro.Composition.impositionSheetNumber., the output is always 01. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 7, 2020 Share Posted January 7, 2020 When using the FusionPro.Composition.impositionSheetNumber., the output is always 01. You need to do these things: Check the "Re-evaluate this rule for every text flow" box.Compose with imposition enabled (not just click Validate in the Rule Editor). Also, are you sure you're looking at a page that's on a sheet other than sheet 1? This is why I mentioned that you probably want to put this barcode down once per sheet, on a custom imposition sheet background, rather that once per-page or per-record. Quote Link to comment Share on other sites More sharing options...
AWhite2504 Posted January 7, 2020 Author Share Posted January 7, 2020 Upon composing, I figured out the numbers that are supposed to represent the sheet number are reflecting the record number. Here is the rule: var data = FormatNumber("00000", Field("Job #")); data += FormatNumber("000000", FusionPro.Composition.inputRecordNumber); data += FormatNumber("0000000", Field("V01_MEMBER_ID")); data += FormatNumber("00", FusionPro.Composition.impositionSheetNumber); return MakeDataMatrixBarcode(data, 0, 0, 4, 4); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 7, 2020 Share Posted January 7, 2020 (edited) Upon composing, I figured out the numbers that are supposed to represent the sheet number are reflecting the record number. Okay... I'm not sure if you're saying that's an issue. If you're using a one-up imposition, then I would expect that the sheet number would match the record number. If not, well, then, it depends on how your imposition is set up, and there are countless possibilities. So, if you want this to be looked at further, you would need to at least post the FPI file, if not the whole template. Also, this is getting off the topic of this thread, which is about DataMatrix barcodes. So I would suggest starting a new thread with any imposition-specific questions. Edited January 7, 2020 by Dan Korn Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.