#1
|
|||
|
|||
![]()
I'm almost positive that there isn't a way to do this in the current FusionPro build but I find myself having to do this quite often.
I usually get clients that like to see one of each of say 5 different "backgrounds" for letters/postcards or whatever. So currently I'm having to search for the record number (1, 5, 17, 68, 250) for example then having to manually compose one record at a time, change the file name and then repeat the process X times. Is there a way to do this at all? Is there a way to make this a feature request? Thanks - Jason |
#2
|
|||
|
|||
![]()
Create a javascript global with:
Code:
var DupeArray = []; Code:
if (DupeArray.indexOf(Field("bg")) > -1 ){ FusionPro.Composition.composeThisRecord = false; } else{ FusionPro.Composition.composeThisRecord = true; DupeArray = DupeArray.concat(Field("bg")); } |
#3
|
||||
|
||||
![]()
What exactly is it that you want to do? Please be more specific.
Do you mean that you want to have your data file sorted into multiple output files? You can do that now* with some special JavaScript code to load the data file into an ExternalDataFileEx object. * "Now" depends on the version of FusionPro you're running. Here's an example of how sort the output of the Frodo Travel tutorial job into multiple output files, by the Destination field: Add this code to the JavaScript Globals: Code:
function Field(name) { var rec = mainDataRecords[FusionPro.Composition.inputRecordNumber-1]; return mainDataFile.GetFieldValue(rec.record, name); } Code:
mainDataFile = new ExternalDataFileEx(PrimaryInputFile()); mainDataSortField = "Destination"; mainDataRecords = []; for (var r = 1; r <= mainDataFile.recordCount; r++) mainDataRecords.push({value:mainDataFile.GetFieldValue(r, mainDataSortField), record:r}); mainDataRecords.sort(function(a,b){if (a.value > b.value) return 1; if (a.value < b.value) return -1; return 0;}); Code:
var rec = mainDataRecords[FusionPro.Composition.inputRecordNumber-1]; for (var fieldName in FusionPro.Fields) FusionPro.Composition.AddVariable(fieldName, mainDataFile.GetFieldValue(rec.record, fieldName), FusionPro.inputTreatFlatDataAsTagged); var sortFieldValue = rec.value; var rec_previous = mainDataRecords[FusionPro.Composition.inputRecordNumber-2]; var previousSortFieldValue = rec_previous ? rec_previous.value : ""; if (sortFieldValue != previousSortFieldValue) FusionPro.Composition.OpenNewOutputFile(FusionPro.Composition.MakeValidFileName(Field(mainDataSortField)) + "." + FusionPro.Composition.outputFormatExtension); A few caveats about this:
We are looking at some enhancements along these lines for an upcoming version of FusionPro VDP (possibly version 10), so that you can just check a couple of boxes to accomplish sorting the main data file, without having to write all of this JavaScript code.
__________________
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)}); ![]() |
#4
|
|||
|
|||
![]()
Hi guys, thanks for the replies. I'm pretty new to FusionPro, only a couple months working with it, I'll try and explain it a little better.
Here's a job that I just got in. ![]() Now normally to send soft proofs I would just pick records 1-9 and compose those. However since there are multiple backs the client has decided that they want to see a sample of each: REFER, PAY, MOBILE etc. So I am currently picking out a record from the data, for example record 5 in my data would pull up the REFER back, and then I compose from record 5 to 5 to get just that record. Then I find the record that would pull PAY and so on. The process to do this is tedious because I have to find the record (if it exists for the back) and then input it, compose, save, find next record, change save name, compose and so on. What would be really optimal would be a compose records 1,2,3... kind of how a print dialogue box would ask for which pages to print; a range or specific pages (in this case records). |
#5
|
||||
|
||||
![]() Quote:
Code:
var records = [1, 8,'4-6']; // Records to compose records = records.map(function(s){ s = String(s); var [a,b] = s.split('-'); a = Int(a); b = Int(b || a); s = [a]; while (a < b) s.push(++a); return s.join('|'); }).join('|'); FusionPro.Composition.composeThisRecord = new RegExp(records, '').test(FusionPro.Composition.inputRecordNumber); Alternatively it seems like you could only compose records that have a unique back by setting up a global array: Code:
var backs = []; Code:
var back = Field("Back"); // Field to determine which back page to turn on if (backs.indexOf(back) > -1) FusionPro.Composition.composeThisRecord = false; backs.push(back);
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#6
|
|||
|
|||
![]()
Maybe index unique outside of FusionPro creating a proof data set, then feeding that into FusionPro.
In excel there's a de-dupe option on data tab, so if there's a field indicating the version, select just the version field and de-dupe will return you one of each version - remember to save it as a new filename and not overwrite the original. |
#7
|
|||
|
|||
![]() Quote:
Code:
A body page does not have master page assigned. A blank page is emitted since no record is composed properly. dlpdfdocwritepdf, progress "Doc->PageCount is zero", error: Bad parameter. PDF Library Document Write Error: Bad parameter. pdf_om_WriteDoc, dtl_pdf_WritePdf returned "-2" Job aborted with error. |
#8
|
||||
|
||||
![]() Quote:
Code:
FusionPro.Composition.SetBodyPageUsage(1, true); Code:
var records = [1, 8,'4-6']; // Records to compose // Turn the array into a Regular Expression records = records.filter(String).map(function(s){ s = Str(s); // convert the value to a string var [a,b] = s.split('-'); // Split the string into an array if there is a dash a = Int(a); // Set lower range limit (a) to an integer b = Int(b || a); // Set upper range limit (b) to an integer (b == a if b is null) s = [a]; // Array to hold all values for a range while (a < b) // Until we reach the upper range limit (b), s.push(++a); // increment 'a' and push it into the array of values (s) return s.join('|'); // Convert the array back to a string, delimited by a pipe (|) }).join('|'); // Convert the entire 'records' array into a string delimited by a pipe (|) // Determine if we should compose this record FusionPro.Composition.composeThisRecord = new RegExp('^(' + records + ')$', '').test(FusionPro.Composition.inputRecordNumber); FusionPro.Composition.SetBodyPageUsage(1, true); // Turn on page 1 /* The above example output: records = '1|8|4|5|6' The Regular Expression used will be: /^(1|8|4|5|6)$/ Testing the input number against the above Regular Expression will return 'true' if it's one of the numbers in the regex and 'false' if it's not. Therefore, the 'composeThisProperty' will in turn reflect the presence of a given record in 'records'. */
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#9
|
||||
|
||||
![]() Quote:
In fact, the same question has already been answered here on this very forum. With a search for "FusionPro record range", like so: http://google.com/search?q=fusionpro+record+range One would find this thread: http://forums.pti.com/showthread.php?t=363 And at the end of my first post there: http://forums.pti.com/showpost.php?p=1157&postcount=4 One would find this code to add to OnRecordStart: 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)}); ![]() |
![]() |
Tags |
composition, fusionpro, output |
Thread Tools | Search this Thread |
Display Modes | |
|
|