Jump to content

mjlongo

Registered Users - Approved
  • Posts

    50
  • Joined

Everything posted by mjlongo

  1. I wanted to follow up and state that I managed to figure out a pretty simple script to solve this issue. Maybe someone else can benefit from this. I just put the fields into an array and parsed from both the front and back of the array. I replaced any field that contained "$0" with the word "ZERO". This then allowed me to print any field that does not contain the word "ZERO". It turned out to be quite easy and worked perfectly for what I needed to do. Refer to the code below: // Create a results variable var results=''; //Trim excess spaces from the fields in the data file var cashLY=Trim(Field("Cash LY")); var cash2Y=Trim(Field("Cash 2Y")); var cash3Y=Trim(Field("Cash 3Y")); var cash4Y=Trim(Field("Cash 4Y")); var cash5Y=Trim(Field("Cash 5Y")); // Put each field into an array var arr = [cashLY,cash2Y,cash3Y,cash4Y,cash5Y] /* check from front of array then the back for any fields that contain "$0". If a field does contain a "$0", replace it with the word "ZERO" Otherwise, break out of the routine if we find a field that has anything other than a "$0". This will result in a middle range. */ // check from front of array for (i=0; i < arr.length; i++){ if(arr[i]=='$0'){ arr[i]='ZERO'; }else{ break; }; }; // check from back of array for (i=arr.length-1; i >=0 ; i--){ if(arr[i]=='$0'){ arr[i]='ZERO'; }else{ break; }; }; /* After parsing through the array, we should be left with fields from the front of the array and then from the back of the array that now have the word "ZERO" in it. We can then use that information to print the range of fields that we have been left with */ if (arr[0]!='ZERO'){results += '2020-2021<t>'+cashLY+'<br>'}; if (arr[1]!='ZERO'){results += '2019-2020<t>'+cash2Y+'<br>'}; if (arr[2]!='ZERO'){results += '2018-2019<t>'+cash3Y+'<br>'}; if (arr[3]!='ZERO'){results += '2017-2018<t>'+cash4Y+'<br>'}; if (arr[4]!='ZERO'){results += '2016-2017<t>'+cash5Y}; return results;
  2. Hello, I have a job where the customer supplies 5 fields. F1, F2, F3, F4 and F5. They will either contain a zero or they will contain a numeric value. I have to select the range from the fields and print that range of fields when they are not zero. Fields inside the range can contain a zero. So for example: F1=50, F2=100, F3=200, F4=300, F5=100: I print all fields. F1=0, F2=100, F3=200, F4=300, F5=100: I print fields F2 through F5. F1=50, F2=100, F3=0, F4=300, F5=0: I print fields F1 through F4. F1=0, F2=0, F3=200, F4=0, F5=100: I print fields F3 through F5. F1=0, F2=0, F3=200, F4=0, F5=0: I print only field F3. I'm pretty sure I can come up with a long list of if statements to handle this but I'm also sure there is a smarter way. Maybe using some kind of test on an array? Any ideas on how to handle this would be greatly appreciated. Thanks!
  3. bkurzbuch, Thank you. I never realized that even existed! :D
  4. Hello, I have a one-page document where I have a text frame in the upper left of the page and a second frame around the lower right section of the page. I want to flow a long stream of text from the upper left frame into the lower right frame. This text will vary so I cannot split it up manually. I've tried to use the overflow but that seems to only allow me to flow the text if I go to a second page. Thanks! Version: FusionPro VDP Creator 10.1.11
  5. Dan, I had forgotten about the XML file and got it working fine for the UserID. The XML solution would work fine for us as we could re-format the XML into a simple csv file. However, I cannot seem to log the page number of the job. I'm sure my issue is nothing more than using the proper command. I tried this within the OnRecordStart: var pgnum = FusionPro.Composition.currentPageNumber; FusionPro.Composition.LogXMLMetadata('MPID',Field("MPID")); //WORKS FusionPro.Composition.LogXMLMetadata('PageNum',pgnum); //DOESNT WORK
  6. I just wanted to follow-up that yes, we can create something that works with how the data was initially read into FusionPro but we want more of an assurance that page numbers are in sync with the user. We cannot afford any missed pages, etc. Thanks!
  7. Hello, We have a need to be able to create a reference csv file that would be output preferably at the same time our FusionPro file composed. Can this be done? We would be creating a final PDF with anywhere from as little as 200 to as many as over 200,000 single page files whereby each page would contain data related to a UserID. Our mailing/inserting equipment sources this PDF for printing data inline as it inserts items into envelopes, etc. We need a "lookup" csv file that would state that UserID is page XX in the PDF. As the mailing/inserting machine is running it would then know that when it scanned the barcode for a UserID, the lookup file would tell the machine that it has to print page XX of the PDF. Any assistance would be appreciated. Thanks! -Mike
  8. Thank you for the info. I will try the newer version
  9. I'm running the following: MACOS Mojave 10.14.6 Adobe Acrobat Pro DC - Version 2020.006.20034 Adobe opens and runs perfectly fine! When trying to install FusionPro 10.0.37 and I receive an error the moment I put in the license. The error states: "FusionPro requires Adobe Acrobat, but Acrobat was not found on this computer. Please install Acrobat and run this installer again". There is no other option but to quit the install. I have a valid license for both version 10 and version 11 of FusionPro through my company. However, I get the exact same error trying to install version 11.0.2 as well. Any assistance would be great. Thanks!
  10. My apologies. Yes, I meant compose. We already found a solution to the particular issue we had. However, I think I would still like some guidance on the best way to use some javascript for when similar situations arise. So what I think I would need is simply this: Can I set every page in the document to "unused" without having to touch every one? If this can be done with a javascript command, that would be fine. But then I would need to be able to specify a certain set of pages for composition. An example might be a document with let us say 500 pages in it. I might have to compose only pages 1, 20, 40, 100, 150 and 250. Or maybe I would need to compose only every 25th page starting from page 1. Thanks!
  11. Hello, I have a document with a couple thousand pages. We have a need to print every 54th page starting on page one. so page 1, then page 55, then page 109 and so on all the way to the end. Is there an easy way to script this? Thanks!
  12. BTW, does that script go in the OnJobStart or OnRecordStart?
  13. Hello, I have a situation where the user might supply a file with say 100 records. Can I setup a rule or script whereby the system will stop reading records after say the 20th record? I do not want to have to manually remove records from the proved file. I want to ensure it never goes above whatever limit I end up setting it at. As a side note: If I set the Record Range on the input tab of the compose settings screen, does this setting remain in place for a fusion pro doc that is "collected" for a Marcom portal? Thanks!
  14. Dan, Thank you very much. Worked perfectly. I was on the right track with function calls however I did not think to place the function where you did right in the same "str.replace" line. There will be an overview for users on usage which will hopefully prevent the repeating of lists issue. If it becomes a necessity, I believe I could resolve the problem simply by using another character (such as a "}") for the new list. I added the ability to choose either Bullets, Numbers/Letters or Roman Numerals. All three choices work great with the help of your code. I have included my entire code below for the benefit of this community. Please note that the triple-x letters within the roman numeral variables are automatically being switched by this forum to asterisk symbols. Must be something related to "adult" content. haha! Thanks again! var str = Field("PARAGRAPH1"); // Number and Letter list type variables var startNum1 = 1; var startNum2 = 1; // roman numeral variables var numeralCodesUP = [["","I","II","III","IV","V","VI","VII","VIII","IX"], // Ones ["","X","XX","***", "XL", "L", "LX", "LXX", "L***", "XC"], // Tens ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"]]; // Hundreds var numeralCodesDN = [["","i","ii","iii","iv","v","vi","vii","viii","ix"], // Ones ["","x","xx","***", "xl", "l", "lx", "lxx", "l***", "xc"], // Tens ["","c","cc","ccc","cd","d","dc","dcc","dccc","cm"]]; // Hundreds // Switch based on chosen list type switch(Field("LISTTYPE")){ case "BULLET": // Bullet Lines - Use { to denote start str = str.replace(/({)([^{])/g,'<p hyphenate="false" tabstops="0;1250,Left,,;2450,Left,,;" lindent="2450"><t>•<t>$2'); // Circle Lines - Use % to denote start str = str.replace(/(%)([^%])/g,'<p hyphenate="false" tabstops="0;3400,Left,,;4700,Left,,;" lindent="4700" suboffset="32" subratio="100"><t><subscript>&cir;</subscript><t>$2'); break; case "NUMBERS": // Numbers Lines - Use { to denote start str = str.replace(/({)([^{])/g,function(m, p1, p2){return '<p hyphenate="false" tabstops="0;1250,Left,,;3700,Left,,;" lindent="3700"><t>' + (startNum1++) + '.<t>' + p2;}); //Letter Lines - Use % to denote start str = str.replace(/(%)([^%])/g,function(m, p1, p2){return '<p tabstops="0;4400,Left,,;6500,Left,,;" lindent="6500"><t>' + Chr(Asc('a') - 1 + startNum2++) + '.<t>' + p2;}); break; case "ROMAN": // Upper Roman Lines - Use { to denote start str = str.replace(/({)([^{])/g,function(m, p1, p2){return '<p hyphenate="false" tabstops="0;1250,Left,,;3700,Left,,;" lindent="3700"><t>' + (convert(startNum1++,1)) + '.<t>' + p2;}); //Lower Roman Lines - Use % to denote start str = str.replace(/(%)([^%])/g,function(m, p1, p2){return '<p tabstops="0;4400,Left,,;6500,Left,,;" lindent="6500"><t>' + (convert(startNum2++,2)) + '.<t>' + p2;}); break; } //regular Paragraph - Use # to denote start str = str.replace(/(#)([^#])/g,'<br><br><p tabstops="0;0,Left,,;" lindent="0" rindent="0">$2'); // Function to convert to roman numerals function convert(num,x) { var numeral = ""; var digits = num.toString().split('').reverse(); for (var i=0; i < digits.length; i++){ if(x==1){numeral = numeralCodesUP[i][parseInt(digits[i])] + numeral;} else{numeral = numeralCodesDN[i][parseInt(digits[i])] + numeral;} } return numeral; } return str;
  15. Users input text into a variable data field. This data will include list items. Each new list row will be tagged with a "{" character. They will also have sublists that will be tagged with a "%" character. So for example: a user might type in some text that looks like this: Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Non odio euismod lacinia at quis risus. {Risus commodo viverra maecenas accumsan {lacus vel facilisis {consectetur adipiscing %elit sed do eiusmod tempor incididunt %ut labore et dolore magna aliqua on %odio euismod lacinia at quis risus. The resulting data should end up looking like this when the data is processed: Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Non odio euismod lacinia at quis risus. •Risus commodo viverra maecenas accumsan • lacus vel facilisis • consectetur adipiscing ° elit sed do eiusmod tempor incididunt ° ut labore et dolore magna aliqua on ° odio euismod lacinia at quis risus. Using similar code as listed below, I am able to achieve the desired results. var str = Field("PARAGRAPH1"); //Bullet Lines str = str.replace(/({)([^{])/g,'<p override="true" hyphenate="false" tabstops="0;1250,Left,,;" lindent="2450"><t>• $2'); return str; My issue now is that the customer is wondering if instead of bullet points, could they have the first list be numbers and then the sublist be letters. I realize they can just type them in but it seems like a nice touch if this could be automated. The results would then look more like this: Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Non odio euismod lacinia at quis risus. 1. Risus commodo viverra maecenas accumsan 2. lacus vel facilisis 3. consectetur adipiscing a. elit sed do eiusmod tempor incididunt b. ut labore et dolore magna aliqua on c. odio euismod lacinia at quis risus. Any assistance with scripting this would be appreciated. Thanks!
  16. I'm using the following code to return an inline graphic: return CreateResource(Field("name") + ".pdf", "graphic"); It works fine. However, the customer did not supply every file necessary. When the file does not exist, I instead want to simply return the name field using an appropriate font. So my question is pretty simple, how do you check that the graphic file indeed exists and if not, run a different set of code? Thanks!
  17. That solution worked just fine. Thanks Dan!
  18. Sorry, I should have included that: We are on macs. Most are running the latest El Capitan. My own is running Sierra 10.12.6. FusionPro is VDP Creator 10.0.3. Thanks!
  19. Hello, I have users who are getting the following error every time they try to open the log file after composing: Could not view log file. Owning application or log file was not found. Can someone assist me with why we might be seeing this? Thanks!
  20. Can someone provide me with some tips/tricks that I need to know in order to implement some Jquery on my portals? I read in another thread that Marcom is using noConflict. What exactly does that mean? Right now I'm just demoing a simple fadeIn, fadeOut of text when hovering over an image but nothing at all is happening. the typical script would look something like this: $(document).ready(function(){ $('.imgRow').hover(function(){ $(this).find('.img-title').fadeIn(300); }, function(){ $(this).find('.img-title').fadeOut(100); }); });
  21. jwhittaker, Thanks! I actually figured out using the meta tag last night. Worked fine!
  22. Hello, Is there a way to redirect a user to a different folder within the catalog? For example: I might have a catalog folder called ITEMS and a subfolder in ITEMS called IMAGES. Then I might have a different folder in the catalog called RESOURCES with a subfolder also called IMAGES. I want the users to be redirected to the RESOURCES/IMAGES folder whenever they click on the ITEMS/IMAGES folder. If this is possible, can you provide some steps on how to accomplish this? Thanks!
×
×
  • Create New...