Jump to content

ricky10ss

Registered Users - Approved
  • Posts

    35
  • Joined

Everything posted by ricky10ss

  1. Thanks Ste. I was going to use a OnRecordStart rule that turns on the correct pages for the slots see example below. To use the parsed data in your example on each page do I need to create a rule for each field and data set I am trying to use? If I want to use Slot2 and value. Do I have to create a rule Slot2CouponValue? and Slot2CouponMileage for the mileage for Slot2?
  2. Attached is a sample data file with Slot1 - Slot68. Each slot could be a voucher or Coupon. The attached image shows what they are trying to do. The first character determines if the page selected is a coupon, voucher or blank. If a voucher then the next three character are the voucher number like SLOT35 in the sample data V203. If a coupon then the 2-3 character is the coupon code, 4-5 is the Service Type code, 6-11 in the mileage, and 12-15 is the value. Would need to parse each out to include the data into the coupon. Anyone have an idea on how to parse this out via Javascript? I could then turn on and off pages based on the it being a coupon, what version of coupon and/or if blank. Sample_Data.txt
  3. Sorry Step I am definitely confused. Sorry. So I should I still use this code for the onRecordStart ? var [ver, state] = Field("version").split(' '); var pdf = CreateResource('/path/to' + Field("version") + '.pdf', 'graphic', true); var pages = pdf.countPages; var form = 20; switch(state) { case 'CO': form = 21; break; case 'LA': form = 24; break; case 'NC': form = 26; break; case 'NV': form = 23; break; case 'SD': form = 22; break; } FusionPro.Composition.repeatRecordCount = pages; var isForm = FusionPro.Composition.repeatRecordNumber == form; FusionPro.Composition.SetBodyPageUsage('page', !isForm); FusionPro.Composition.SetBodyPageUsage('form', isForm); Or this one as the OnRecordStart? var state = Field("State"); var pdf = '/path/to/LN-3001'; var form = 20; switch(state) { case 'CO': form = 21; break; case 'LA': form = 24; break; case 'NC': form = 26; break; case 'NV': form = 23; break; case 'SD': form = 22; break; } if (form > 20) pdf += ' ' + state; pdf = CreateResource(pdf + '.pdf', 'graphic', true); Do all the "form" and "page" pages get the same graphic variable assigned to them? I used this below. Right now only the first page comes in when I compose. if (Field("State") == "CO") { var pdf = "LN-3001 CO.pdf"; } else if (Field("State") == "LA") { var pdf = "LN-3001 LA.pdf"; } else if (Field("State") == "NC") { var pdf = "LN-3001 NC.pdf"; } else if (Field("State") == "NV") { var pdf = "LN-3001 NV.pdf"; } else if (Field("State") == "SD") { var pdf = "LN-3001 SD.pdf"; } // ... else { var pdf = "LN-3001.pdf"; } var pdf = CreateResource('G:\\BTS\\Variable Elements\\LifeShield STM UltraCare\\' + pdf ); pdf.pagenumber = FusionPro.Composition.repeatRecordNumber; return pdf;
  4. I created a OnRecordStart rule using the last bit of code you sent but nothing seems to be happening. I validate rule and Expression is OK. Do I need to do something with the graphic frame since no variable is assigned? Could it be this is incorrect? var pdf = 'G:\VP\Variable Elements\LifeShield\LN-3001.pdf';
  5. Sorry I am not trying to combine "LNG-3001.pdf" and all pages in "LN-3001 CO.pdf". So it sounds like your first response is what I am trying to do. With the code you posted below I have another question. How would I call the forms only from a field called State? I don't have a field calling out the specific name of the form. All I have in data provided to me is the State. So if the state equals to CO then I need to pull the resource "LN-3001 CO.pdf" and so one for LA, NC, NV, SD. All other states get "LN-3001.pdf". var [ver, state] = Field("version").split(' '); var pdf = CreateResource('/path/to' + Field("version") + '.pdf', 'graphic', true); var pages = pdf.countPages; var form = 20; switch(state) { case 'CO': form = 21; break; case 'LA': form = 24; break; case 'NC': form = 26; break; case 'NV': form = 23; break; case 'SD': form = 22; break; } FusionPro.Composition.repeatRecordCount = pages; var isForm = FusionPro.Composition.repeatRecordNumber == form; FusionPro.Composition.SetBodyPageUsage('page', !isForm); FusionPro.Composition.SetBodyPageUsage('form', isForm);
  6. Thanks Ste. Yes I noticed that after as well that the text boxes are not in the same locations. So with this rule you are just pulling in the specific pages correct? What if I need to pull in the whole form all pages for the standard form and all pages for the state forms? The only way I could think is make a page for all the common count pages till each variable pages then bring in the pages after. But the issue there is MO state form only has 22 total pages. Some of the state forms variable pages are past page 22.
  7. Attached are two documents. LNG-3001.pdf is the standard form and has the variable boxes only all states except CO, LA, MO, NC, NV and SD. LN-3001 CO.pdf is the form only for CO. The variable text boxes are on page 21. Each state form has the variable boxes on different pages.LN-3001 CO.pdf LNG-3001.pdf
  8. I am trying to figure out the most simple way to import multiple pdf's that have the same variable text boxes in the same location but on different pages. Below are the document names and the page the variable text fields are on. Everyone gets the standard form but if they are in any of the states below they get that specific state form. LNG-3001 (Standard form - Page 20) LN-3001 CO (Colorado – Page 21) LN-3001 LA (Louisiana – Page 24) LN-3001 MO (Missouri – Page 20) LN-3001 NC (North Carolina – Page 26) LN-3001 NV (Nevada – Page 23) LN-3001 SD (South Dakota – Page 22) In the past I was able to use the code below to import specific pages till I got to the variable page 4 then import the rest of the pages since all documents had the variable on the same page. Bringing in specific page: var image = CreateResource(path + image,"graphic",true); image.pagenumber = 1; return image; Then the last pages after page 4: var result = []; var r = CreateResource(path + image,"graphic",true); for (r.pagenumber = 4; r.pagenumber <= r.countPages; r.pagenumber++) result.push(r.content); return result.join("<p>\n");
  9. Was wondering is there a way to change the composed output file to sort alphabetically by the last name which is a field in the csv file instead of the sequence provide in the csv? I would be using FP Imposer to impose.
  10. Below is the onRecordStart rule I was using but I found out I need to adjust to another field. The switch rule below is turning on the specific pages based off their plan. But there is a value field called "Amount" that if there is no value for 250, 500, 750 and 1000 plans they do not get 250_500_750_1000NonInsured P1 or 250_500_750_1000NonInsured P2. What would you recommend doing for this? switch (Field("PLANOPTION")) { case "200": FusionPro.Composition.SetBodyPageUsage("200 P1", true) FusionPro.Composition.SetBodyPageUsage("200 P2", true) FusionPro.Composition.SetBodyPageUsage("200NonInsured P1", true) FusionPro.Composition.SetBodyPageUsage("200NonInsured P2", true) break; case "250": FusionPro.Composition.SetBodyPageUsage("250 P1", true) FusionPro.Composition.SetBodyPageUsage("250 P2", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P1", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P2", true) break; case "500": FusionPro.Composition.SetBodyPageUsage("500_750_1000 P1", true) FusionPro.Composition.SetBodyPageUsage("500_750_1000 P2", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P1", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P2", true) break; case "750": FusionPro.Composition.SetBodyPageUsage("500_750_1000 P1", true) FusionPro.Composition.SetBodyPageUsage("500_750_1000 P2", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P1", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P2", true) break; case "1000": FusionPro.Composition.SetBodyPageUsage("500_750_1000 P1", true) FusionPro.Composition.SetBodyPageUsage("500_750_1000 P2", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P1", true) FusionPro.Composition.SetBodyPageUsage("250_500_750_1000NonInsured P2", true) break; }
  11. Hello, Have a field that is currency and wanting to multiple the field by 3. Example, $150 * 3 = $450. Anyone have any suggestions? Thanks
  12. Thanks Ste! You know your stuff. So trying to understand your last rule below. So if I want to include Cert3_1 for all generic states but Cert3_2 for only ID and IL. And Cert4_1 for all generic states but Cert4_2 for only IL and OK. How would I adjust? This should let me figure out the next page of variables. Thanks again! ['Cert1_1','Cert1_2','Cert2_1','Cert2_2'] .forEach( function(s) { var cert = Int(Field('Cert ID') - 1); var states = [ ['OH','TX'], ['ID','IL','OK'] ][cert]; var frame = 'Cert' + Field('Cert ID') + '_' + ((states.indexOf(Field('State')) > -1) + 1); FindTextFrame(s).suppress = s != frame; });
  13. Hello, Need some help with a project I am working on. We have 4 generic certificates that will go to specific states that are generic. There are also 4 certificates that could be state specific. On page 3 of the certificate there is one variable but depending on the state and certificate the text box location is different. I am trying to create a rule that looks at the Cert ID first then specific states would have their own Text frame. Below is what I started with and is not working for what I want. The first if statement is working for the two Cert 1 text boxes but all the Cert 2 text boxes are still on and vice versa. if (Field("Cert ID") == "1") { if ((Field("State") == "OH") || (Field("State") == "TX")) FindTextFrame("Cert1_1").suppress = true; else FindTextFrame("Cert1_2").suppress = true; } else { if (Field("Cert ID") == "2") { if ((Field("State") == "ID") || (Field("State") == "IL")) FindTextFrame("Cert2_1").suppress = true; else FindTextFrame("Cert2_2").suppress = true; } }
  14. Hi Step, Attached is the template and data file. Would not want any duplicate answers in any of the Bingo columns. I have text fields for each box as well. Thanks Canstruction Bingo.pdf BINGO Questions.txt
  15. Hello, I was able to use the original code to generate random facts but I need to make an adjustment and wanted to see if someone has a recommendation. This is for a Bingo card where there are questions and the answers will be printed on the Bingo card. So column B should only have 15 answers that are different from the 15 answers in column I for example. I have a data file that has B,I,N,G,O answers separated out and there is a total of 15 answers for each column? Thanks Rick
  16. I was going to do the overflow option from that thread but the only problem is the third page has variable elements all over the page.
  17. Thanks Ste again! Question to input this as a graphic I tried making the rule a text rule and check "Treat returned strings as tagged text" but I just get the name of the pdf in the text box. When I create the rule as a graphic I get an error "This graphic rule must return a Resource of type graphic". How would I set this to input the PDF that is being called from the rule? With one of the states ,KY, all the 16 plans have 26 pages. All other plans have 28 pages. I am going to insert additional pages after the plan. I can insert 2 blank pages in the KY plans to make them even to 28 pages. But I would prefer for the files to not have blank pages as I am going to output each record separately by the fields on the list. Is the only way to do this using the SetBodyPageUsage with an onRecordStart rule? I think if I base the rule off the state I should be able to turn on and off all the pages needed, correct?
  18. Question for you Ste. So this works now with the adjustment. But if there is only one record then the rule is not outputting a separate cover and ticket pdf. I just get a file named whatever I call the output file with the cover and ticket all in one pdf. Any idea of a fix for when there is just one record?
  19. Hello, Looking for some help on a project I am working on. There are a total of 12 states that have specific plans based on the state and the plan number. AL, AR, DE, MS, NE, NM, NV, OK, PA, WI have 16 plans. So I have 16 PDF's that are 28 page PDF's. There is a field called "Plan" that determines what PDF is needed. KY has 16 different plans determined based on the field "Plan". There are 16 PDF's that are 26 page PDF's. ND has 16 different plans determined based on the field "Plan". There are 16 PDF's that are 28 page PDF's. I attached the rule I am using to pull the correct resource for the first page of my project. I also attached the data file and template. The third page as variable text fields. What I am trying to do is pull page 1, 2 and 3 with the Graphic Switch rule. I would like page 4 to just over flow from the plan PDF's based on the state and plan. I then have state specific forms and endorsements I will then add. Does anyone have any recommendations and am I doing this the long route? Rule.txt ASFLIC STM Sample File 2015 05 06.txt AFSLIC_Short_Term_V1.pdf
  20. Wow, thanks Ste! Everything is working like a charm except one thing. Trying to figure out why the first record is only outputting one page of "p1" instead of 3 from the data field "Books" for the "WO#" + "_Cover" file. All other records are outputting the correct pages? I attached my pdf of test job.Cover Template_r3.pdf
  21. Hello, I found a post that almost completed a project I am trying to compose. I have a two page document. The first page is the job ticket "ticket" the second page is the cover "p1". I am wanting to output two PDF's for the whole job. I attached a data file sample. You can see all records will always be the same WO#. I want one PDF that is page one "ticket" duplicated for as many records are in the file. So this example would have an output file name of 847_ticket.pdf with 9 pages. The second PDF would be all the covers "p1" combined to print based on the Books field value. So this would be 47 pages of "p1" named 847_Cover.pdf. Below is the current code I have that is outputting page 1 "ticket" then page 2 "p1" times the Books value and so on for each record. Do you have any recommendations to help? // enter number of copies needed per record var copies = Field("Books"); // add one for the trailing job ticket FusionPro.Composition.repeatRecordCount = copies; //generate duplicate pages per record if (FusionPro.Composition.repeatRecordNumber > copies) { FusionPro.Composition.SetBodyPageUsage("p1", false); } else if (FusionPro.Composition.repeatRecordNumber > 1) { FusionPro.Composition.SetBodyPageUsage("ticket", false); } Input.txt
  22. Hi Dan, This is working great for what I need but wanted to add one element to finalize the automation of a project I am working on. I have a two page template. Each page is outputting to separate PDF's using the rule you provided. I need the first page to output duplicate pages of the first page based on a field called "Book". So if the field "Book" has the number "4" then the first page will output to 4 pages of the first page. Have any suggestions? Thanks
×
×
  • Create New...