#1
|
|||
|
|||
![]()
Hi, everybody! First time posting. I've got a problem in getting a properly-formatted Datamatrix barcode to print for use with our intelligent inserter. It has to be of the format X999999SSTT where XX is a string, 999999 is a zero-padded sequence number, SS is a zero-padded number representing the current sheet, and TT is a zero-padded number representing the total sheets being inserted. Here is the code I came up with:
Code:
{ // Rule converted from XML Template "DataMatrix Barcode Rule": /* The goal here is to generate the proper Datamatrix 2D barcode * using the established pattern for our Rival inserter. * FusionPro does not have the notion of simplex/duplex, so we * have to state up front what that is. */ // Choose the following values: var JobIDseq = "INSCODE"; // Standard EDWARDS field name var TotalSheets = "SHEETS"; // Standard EDWARDS field name var Sides = "Simplex"; // Use Duplex here for duplex jobs. Mixed modes are not supported. :p var EncodingMode = "ASCII"; var PreferredFormat = "0"; var PointSize = 6; // "Font size (defaults to 10)": SingleLine var NoFontTag = false; var Font = "IDAutomationDMatrix"; var ProcessTilde = false; var TotSheets = FormatNumber( "00", FieldOrRule( TotalSheets ) ); // For simplex jobs, the current sheet is simply the page number. // For duplex jobs, we have to do some basic math. var CurrSheet = Sides == "Simplex" ? FormatNumber( "00", FusionPro.Composition.currentPageNumber ) : FormatNumber( "00", Math.ceil( FusionPro.Composition.currentPageNumber / 2 ) ) ; var DataToEncode = FieldOrRule( JobIDseq ) + CurrSheet + TotSheets; return MakeDataMatrixBarcode( DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font ); } |
#2
|
||||
|
||||
![]()
The FusionPro.Composition.currentPageNumber property returns the page number in the record, so if each record is outputting one or two pages, it will always be page one or two, in every record. You can use FusionPro.Composition.pageNumberInJob instead. But in an imposed job, you probably want FusionPro.Composition.impositionSheetNumber. The FusionPro.Composition.impositionSheetIsBack property may be useful as well.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral 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)}); ![]() |
#3
|
|||
|
|||
![]()
Yes, I get that, and it's what I expect, but this code is returning "00" for CurrSheet in every instance. I was hoping someone could tell me if my syntax is wrong or what the problem might be.
|
#4
|
|||
|
|||
![]()
Further testing shows that although when I run Validate during rule construction I get the correct value, when the job previews or is composed, it still shows "00" every time. Am I not understanding how this is supposed to work, or is there a bug?
|
#5
|
||||
|
||||
![]() Quote:
Did you try using FusionPro.Composition.impositionSheetNumber instead, as I recommended? Posting the template would probably be helpful than more rounds of back-and-forth like this. Quote:
Second, if you validate the rule you've posted, all you will get are some markup tags that make a DataMatrix barcode, which look something like this: Code:
<f name="IDAutomationDMatrix"><z newsize="10"><leading newsize="100">AIHPDOCIHK<br>AEMONMCLLK<br>DLLDDDLDLL<br> Preview is a completely invalid test here as well, since you're not imposing the output, you're just previewing a single record, one-up. Again, how does it "show" this? Are you scanning the barcode? With what scanning device and software? Perhaps posting a picture of the barcode would give me some idea of what you're talking about. Though as I said, the template would be better. Quote:
I'm trying to help. But I don't have your data, or the rest of your template. I don't know what you're seeing in the output, or how you're analyzing it. I can only look at the code you've posted and try to guess as to what's wrong. Please post the template so I can fully analyze the issue.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral 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; June 7th, 2018 at 11:35 AM.. |
#6
|
||||
|
||||
![]()
I think this will work:
Code:
var TotSheets = FormatNumber( "00", FusionPro.Composition.impositionTotalSheets ); var CurrSheet = FormatNumber( "00", FusionPro.Composition.impositionSheetNumber ); Again, I don't have your job files, so I can't test this for you in the context of your job. But I do know that those properties work in the sample job posted here: http://forums.pti.com/showpost.php?p=11530&postcount=3 That sample also shows how to put per-sheet post-press control barcodes and other such information on the imposed sheet, outside the area of the imposed page contents, which is probably what you want to do for your inserter anyway.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral 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)}); ![]() |
#7
|
|||
|
|||
![]()
My apologies. I guess I wasn't being clear. There is no imposition on this job. Each record gets 6 letter-size pages duplexed on 3 sheets of paper as output. For our inserter equipment to properly read the barcode, a portion of the barcode must read 0103, 0203, and 0303 (sheet 1 of 3, 2 of 3, and 3 of 3). This tells the inserter when it is done with one record and can fold and insert, and move on to the next set. However, this code produces 0003 for every page. We checked it with a barcode scanning app known to work. It scans just fine, but the value returned is not what we need.
As a test of what currentPageNumber returns, I made a simple rule and inserted it into the cellphone.pdf tutorial piece: Code:
var CurrPage = FusionPro.Composition.currentPageNumber; return CurrPage; I am new to these forums and am hesitant to post customer data and/or art in this public space. However, we did send it to Alex at Marcom support on Friday, but his response was word-for-word the same as your initial post here and we haven't heard a response to my follow-up. If we weren't under a time crunch on this project, I wouldn't be following both methods of inquiry. Thanks for your assistance. |
#8
|
||||
|
||||
![]()
Can you specify the exact versions of FusionPro, Acrobat, and your operating systems?
Quote:
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral 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)}); ![]() |
#9
|
|||
|
|||
![]()
That checkbox solved the problem.
Thanks! |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|