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 February 25th, 2019, 07:38 AM
jpmiller jpmiller is offline
Junior Community Member
 
Join Date: Dec 2016
Location: Jacksonville, FL
Posts: 19
Question DataMatrix with sheet number

Below is the code I am using to generate a 25 character DataMatrix barcode.

// Rule converted from XML Template "DataMatrix Barcode":
// Choose the following values:
// Begin XML Template selections //

var jobID = "0103999"; // 7 digit
var sequence = Field("sequence"); // 6 digit
var currSheet = FormatNumber( "00", FusionPro.Composition.impositionSheetNumber ); // 2 digit
var totSheets = FormatNumber( "00", FusionPro.Composition.impositionTotalSheets ); // 2 digit

var feeder1 = Field("feeder1"); // 1 digit
var feeder2 = Field("feeder2"); // 1 digit
var feeder3 = Field("feeder3"); // 1 digit
var feeder4 = Field("feeder4"); // 1 digit
var feeder5 = Field("feeder5"); // 1 digit
var feeder6 = Field("feeder6"); // 1 digit
var divertBin = Field("divertbin"); // 1 digit
var sortYN = Field("sort"); // 1 digit
var EncodingMode = "Text";
var PreferredFormat = "0";
var PointSize = StringToNumber("6");
var NoFontTag = false;
var Font = "IDAutomationDMatrix"; //
var ProcessTilde = false;
// End XML Template selections //

var DataToEncode = (jobID + sequence + currSheet + totSheets + feeder1 + feeder2 + feeder3 + feeder4 + feeder5 + feeder6 + divertBin + sortYN);
return MakeDataMatrixBarcode(DataToEncode, ProcessTilde,
EncodingMode, PreferredFormat,
PointSize, NoFontTag, Font);

Need a unique DataMatrix barcode on front of each sheet of a set.
(sheet = front+back. NON-IMPOSED) Imposition is done at print device.
(set = 2 sheets)

The Sheet Counter should generate four digits. (0102, 0202; 0102, 0202; etc...)
The result I am getting is always 0100 for each record.

I have also tried the CurrentPage counter too.
I just can't figure out how to get the counter to work properly.
Please help.
Attached Files
File Type: pdf 2D Barcode Sheet counter.pdf (60.2 KB, 4 views)
File Type: zip test data.csv.zip (1.5 KB, 2 views)
File Type: pdf test data-Output.pdf (39.5 KB, 3 views)
Reply With Quote
  #2  
Old February 25th, 2019, 10: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,332
Default Re: DataMatrix with sheet number

As their names suggest, properties like FusionPro.Composition.impositionSheetNumber and FusionPro.Composition.impositionTotalSheets work only if you're actually using Imposition (with an FPI file created in FusionPro Imposer, specified on the Imposition tab of the Composition Settings dialog, after checking the "Use Imposition Definition" box).

As you discovered, since you have the "Re-evaluate this rule for every text flow" box checked in your rule, you can use the properties
FusionPro.Composition.currentPageNumber and FusionPro.Composition.totalPages instead. However, those will output per-record page numbers, not per-job page or sheet numbers.

Frankly, the entire concept of "Need a unique DataMatrix barcode on front of each sheet of a set" is meaningless in a non-imposed job, since technically there are no output "sheets" or "sets" at all, just pages. (And the fact that you intend to impose the job on the press/RIP at some point in the future doesn't impact whether FusionPro knows to treat the job as imposed when it's doing the composition, let alone whether FusionPro knows how the pages might hypothetically be laid out onto imposed sheets by such a future process.)

Even if you do know exactly how the job is going to be imposed in the future, i.e. how many pages will go onto each imposed sheet (the "n" in "n-up"), then you could theoretically just do some math with the FusionPro.Composition.pageNumberInJob property to figure out what the sheet number will be for each page. But, FusionPro does NOT have a FusionPro.Composition.totalPagesInJob property, because it doesn't do a "look ahead" or pre-processing step to determine exactly how many records or pages (or sheets) will be composed unless it needs to do that for (stacked) imposition.

Furthermore, if you are using barcodes which really are per-imposed sheet, rather than per-page, then you probably don't want to output those numbers on the pages themselves at all. Instead, you want to output the barcode once on each imposed sheet, outside of the trim area of any finished page. The way to do this is to set a custom imposition sheet background, as in the example here:
http://forums.pti.com/showpost.php?p=11530&postcount=3

Again, though, all of that requires that FusionPro is doing the imposition. Otherwise, FusionPro has no way of looking into the future to a scenario where you might possibly be re-processing its composed output, such as by imposing it on a press or RIP, therefore it has no way to know what sheet numbers to typeset or encode into a barcode when it's composing.
__________________
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 February 25th, 2019, 11:20 AM
jpmiller jpmiller is offline
Junior Community Member
 
Join Date: Dec 2016
Location: Jacksonville, FL
Posts: 19
Default Re: DataMatrix with sheet number

Thank you Dan.

I was trying to create a DataMatrix 2D barcode that included the page number and page count so the mail Inserter would know when a particular set started and ended. I wanted to automate the counter in case there were variable number of pages per set.
Reply With Quote
  #4  
Old February 25th, 2019, 01:39 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,332
Default Re: DataMatrix with sheet number

Quote:
Originally Posted by jpmiller View Post
I was trying to create a DataMatrix 2D barcode that included the page number and page count so the mail Inserter would know when a particular set started and ended. I wanted to automate the counter in case there were variable number of pages per set.
Okay. Though that seems to be a very different description of what you're trying to accomplish then what you wrote in your original post, which included this:
Quote:
Originally Posted by jpmiller View Post
(sheet = front+back. NON-IMPOSED) Imposition is done at print device.
(set = 2 sheets)
Which, as I read it, pretty much defines a set number of pages per sheet, and therefore per set. Unless I'm misunderstanding what you meant in the first place.

Anyway, my question back to you now is: Exactly what specifies or determines how many pages/sheets make up a set? If you know how to determine or calculate that number at the time of the FusionPro composition, then we can use that number to make the barcode. But FusionPro doesn't have any independent way of figuring that out for you, because, again, it doesn't know what intent you have for re-organizing its output in the future.
__________________
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
  #5  
Old February 26th, 2019, 04:34 AM
jpmiller jpmiller is offline
Junior Community Member
 
Join Date: Dec 2016
Location: Jacksonville, FL
Posts: 19
Default Re: DataMatrix with sheet number

Quote:
Originally Posted by Dan Korn View Post
As you discovered, since you have the "Re-evaluate this rule for every text flow" box checked in your rule, you can use the properties FusionPro.Composition.currentPageNumber and FusionPro.Composition.totalPages instead. However, those will output per-record page numbers, not per-job page or sheet numbers.
Dan, I think we are getting somewhere now. I wasn't clear in my first post, but I do want a current sheet number and total sheets per record in the barcode for the Inserter to scan. The scanner only scans the front of the sheet.

In this particular instance the total pages per record is constant. The numbers will alternate 0102, 0202. I can manually configure this in the data. I was just trying to automate the function for a possible instance where the total pages per record could vary depending on the data -- perhaps using trigger fields.

(To be clear: I come from commercial printing; a page is either the front or back of a sheet; a sheet is the front and back of a set; a sig or signature is an imposition of sheets)

Thank you for all you do, your time and your patience.
Reply With Quote
  #6  
Old February 26th, 2019, 11:27 AM
jpmiller jpmiller is offline
Junior Community Member
 
Join Date: Dec 2016
Location: Jacksonville, FL
Posts: 19
Default Re: DataMatrix with sheet number

One solution that does work is to create multiple rules.

1) OnPageCount rule.
2) OnPageNumber rule.
3) OnRecordStart rule to determine which pages to output.
4) DataMatrix barcode rule for each possible front page
5) DataMatrix barcode rule...
6) DataMatrix barcode rule...

A bit hideous but it does work.
Attached Images
File Type: png List of rules.png (46.4 KB, 6 views)
Attached Files
File Type: pdf DataMatrix Page Counter.pdf (212.9 KB, 3 views)
Reply With Quote
Reply

Tags
datamatrix, page counter, sheet counter

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 09:27 AM.


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