Jump to content

jpmiller

Registered Users - Approved
  • Posts

    23
  • Joined

Converted

  • Location
    Jacksonville, FL

Converted

  • Occupation
    PrePress/Variable Data/Mailing Technician

Converted

  • FusionPro Products
    Yes

Converted

  • FusionPro VDP software version
    10.0.26

Converted

  • OS
    MAC OS 10.13.6

Converted

  • Acrobat Version
    Acrobat DC

jpmiller's Achievements

Explorer

Explorer (4/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

10

Reputation

  1. Hi, I am trying to get the loop below to run through the record count and execute different results based on the quantity. The rule below never gets past the first if statement. Not sure what I am doing wrong. Any help would be appreciated. var nameFieldName = "first"; var data = new ExternalDataFileEx(PrimaryInputFile()); var totalRecs = data.recordCount; for (i = 0; i < totalRecs; i++) { if (totalRecs = 5000) { var recordsPerBox = (2500); } else if ((totalRecs > 2500) && (totalRecs < 5000)) { var recordsPerBox = Math.ceil(totalRecs / 2); } else (totalRecs < 2500) { var recordsPerBox = (totalRecs); } } var numBoxes = Math.ceil(totalRecs / recordsPerBox); FusionPro.Composition.repeatRecordCount = numBoxes; var boxNum = FusionPro.Composition.repeatRecordNumber; var boxStartRec = (boxNum - 1) * recordsPerBox + 1; var boxEndRec = Math.min(boxNum * recordsPerBox, totalRecs); FusionPro.Composition.AddVariable("totalRecs", totalRecs); FusionPro.Composition.AddVariable("boxNum", boxNum); FusionPro.Composition.AddVariable("numBoxes", numBoxes); FusionPro.Composition.AddVariable("boxStartRec", boxStartRec); FusionPro.Composition.AddVariable("boxEndRec", boxEndRec); FusionPro.Composition.AddVariable("boxStartName", data.GetFieldValue(boxStartRec, nameFieldName)); FusionPro.Composition.AddVariable("boxEndName", data.GetFieldValue(boxEndRec, nameFieldName));
  2. Thank you very much for your solution. I did end up with another solution. I moved the Header Shading up to the Header Declaration section. //Be sure to check "Treat returned strings as tagged text"// //This will create a table filled with record rang dependenat upon (var recordsPerBox)// //Creat this as a textRule //Include OnJobStart rule "OnjobStart_not all records"" var recordsPerBox = 2500; var nameFieldName = "first"; var table = new FPTable; var numColumns = 13; for (var c = 0; c < numColumns; c++) { var width = 2500; if (c == 0) width = 3500; if (c == 1) width = 3500; if (c == 2) width = 6500; if (c == 3) width = 11500; if (c == 4) width = 11500; table.AddColumn(width); } var data = new ExternalDataFileEx(PrimaryInputFile()); var totalRecs = data.recordCount; var numBoxes = Math.ceil(totalRecs / recordsPerBox); for (var boxNum = 0; boxNum <= numBoxes;boxNum++) { var row = table.AddRow(); if (boxNum == 0) { //row.type = row.Header; //new solution - HEADER DECLARATION table.Rows[0].Type = "Header" table.Rows[0].Cells[0].ShadeColor = "Black"; table.Rows[0].Cells[0].ShadePct = 100; table.Rows[0].Cells[0].TextColor = "White"; table.Rows[0].CopyCells (0,1,2,3,4,5,6,7,8,9,10,11,12); row.SetContents("Sec#", "Box #", "Records Range", "first rec.", "last rec."); } else { var boxStartRec = (boxNum - 1) * recordsPerBox + 1; var boxEndRec = Math.min(boxNum * recordsPerBox, totalRecs); var boxStartName = (data.GetFieldValue(boxStartRec, nameFieldName)); var boxEndName = (data.GetFieldValue(boxEndRec, nameFieldName)); row.Cells[0].Content = ""; row.Cells[1].Content = boxNum + "/" + numBoxes; row.Cells[2].Content = boxStartRec + "-" + boxEndRec; row.Cells[3].Content = boxStartName; row.Cells[4].Content = boxEndName; } for (var c = 0; c < numColumns; c++) { var cell = row.Cells[c]; cell.HAlign = "Center"; cell.SetBorders("Thin", "Black", "Top", "Bottom", "Left", "Right"); cell.Margins = { Top:45, Bottom:45, Left:20, Right:20 }; if (boxNum == 0) { //Moved to Header Declaration //cell.TextColor = "White"; //cell.ShadeColor = "Black"; //cell.ShadePct = 100; } } } table.ShadingColor1 = "Black"; table.ShadingPct1 = 30; table.ShadingRepeat1 = 2; table.ShadingColor2 = "White"; table.ShadingRepeat2 = 2; table.ShadingType = "ByRow"; return table.MakeTags();
  3. Hello, I am trying to set my row shading to be every two rows. The problem I am having is that the first row starts shaded then the every two row pattern starts. How do I get the shading to be correct? This is the bit of code I am using to set the Shading Pattern: for (var c = 0; c < numColumns; c++) { var cell = row.Cells[c]; cell.HAlign = "Center"; cell.SetBorders("Thin", "Black", "Top", "Bottom", "Left", "Right"); cell.Margins = { Top:45, Bottom:45, Left:20, Right:20 }; if (boxNum == 0) { cell.TextColor = "White"; cell.ShadeColor = "Black"; cell.ShadePct = 100; } } } table.ShadingColor1 = "Black"; table.ShadingPct1 = 30; table.ShadingRepeat1 = 2; table.ShadingColor2 = "White"; table.ShadingRepeat2 = 2; table.ShadingType = "ByRow"; return table.MakeTags(); I have also included a screenshot. Thank you for your help. VDP WorksheetNEW.pdf test data.csv.zip
  4. 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. DataMatrix Page Counter.pdf
  5. 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.
  6. 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.
  7. 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. 2D Barcode Sheet counter.pdf test data.csv.zip test data-Output.pdf
  8. I am trying to rework the math of the rule so that a batch is split in two for boxing purposes with no more than 2,500 per box. Here is the existing rule. // I think there needs to be a loop here to determine the current batch quantity var runBatch = (i !< (cannot be greater than) 5000); // insert for Loop here to check for i > 5000 // else if runBatch =< 5000 var recordsPerBox = runBatch / 2; var nameFieldName = "first"; var data = new ExternalDataFileEx(PrimaryInputFile()); var totalRecs = data.recordCount; var numBoxes = Math.ceil(totalRecs / recordsPerBox); FusionPro.Composition.repeatRecordCount = numBoxes; var boxNum = FusionPro.Composition.repeatRecordNumber; var boxStartRec = (boxNum - 1) * recordsPerBox + 1; var boxEndRec = Math.min(boxNum * recordsPerBox, totalRecs); FusionPro.Composition.AddVariable("totalRecs", totalRecs); FusionPro.Composition.AddVariable("boxNum", boxNum); FusionPro.Composition.AddVariable("numBoxes", numBoxes); FusionPro.Composition.AddVariable("boxStartRec", boxStartRec); FusionPro.Composition.AddVariable("boxEndRec", boxEndRec); FusionPro.Composition.AddVariable("boxStartName", data.GetFieldValue(boxStartRec, nameFieldName)); FusionPro.Composition.AddVariable("boxEndName", data.GetFieldValue(boxEndRec, nameFieldName)); VDP Label Sheet_new.pdf label test file_more than 5000.csv.zip
  9. I have had the same problem. Most notably when I export the FP template from InDesign with bleed. The FP template in Acrobat will display the document by the trim size. I have to set the Media Box and Crop Box to the Bleed size - so my FP Template is the bleed size. This usually solves the problem. Or export the PDF from InDesign with bleed but no marks so the document is the bleed size, and then import or set-up the FP Template.
  10. Have had similar problems. My usual fix is to make sure the document is the same size as the bleed - if any. If my document is same as trim size, but there is bleed, it will often cause a shift of the image/data.
  11. This code is exactly what I have ben looking for! Thank you so very much, this works perfectly. :)
  12. When I use the toTitleCase function I would like the letter after / to be capitalized. The data source contains names with / i.e.: MARY/ANN to Mary/ann is what I get now i.e.: MARY/ANN to Mary/Ann is the result expected Also: How do I retain suffix capitalization when the name is one field? i.e.: John Doe, III instead of John Doe, Iii Thank you, Jeff
  13. I am making a production worksheet that includes the number of boxes and the set range of records per box. Attached is a FP Template with JavaScript used to create the box labels along with a mock .csv file. I am thinking there is some Loop function that would do this. The idea is to fill the one sheet up to 25 boxes. Thank you for any help you can give.file for box label.csv.zip VDP Worksheet_formFP.pdf
  14. Here is the final JavaScript. I duplicated it for each instance I needed and changed the return value accordingly. Had to add var boxStartName and var boxEndName, Also changed OnRecordStart to OnJobStart. Thank you for your help with this! This will be a valuable time saver. :) // automation of box label entries // nameFieldName should be mapped to appropiate field use var recordsPerBox = 2500; var nameFieldName = "first"; var data = new ExternalDataFileEx(PrimaryInputFile()); var totalRecs = data.recordCount; var numBoxes = Math.ceil(totalRecs / recordsPerBox); FusionPro.Composition.repeatRecordCount = numBoxes; var boxNum = FusionPro.Composition.repeatRecordNumber; var boxStartRec = (boxNum - 1) * recordsPerBox + 1; var boxEndRec = Math.min(boxNum * recordsPerBox, totalRecs); var boxStartName = (data.GetFieldValue(boxStartRec, nameFieldName)); var boxEndName = (data.GetFieldValue(boxEndRec, nameFieldName)); FusionPro.Composition.AddVariable("totalRecs", totalRecs); FusionPro.Composition.AddVariable("boxNum", boxNum); FusionPro.Composition.AddVariable("numBoxes", numBoxes); FusionPro.Composition.AddVariable("boxStartRec", boxStartRec); FusionPro.Composition.AddVariable("boxEndRec", boxEndRec); FusionPro.Composition.AddVariable("boxStartName", data.GetFieldValue(boxStartRec, nameFieldName)); FusionPro.Composition.AddVariable("boxEndName", data.GetFieldValue(boxEndRec, nameFieldName)); return boxEndName;
×
×
  • Create New...