Jump to content

CCS_Printing

Registered Users - Approved
  • Posts

    42
  • Joined

Converted

  • FusionPro Products
    Yes

Converted

  • FusionPro VDP software version
    12.1.3

Converted

  • OS
    Mac OS 12.6

Converted

  • Acrobat Version
    Acrobat DC

CCS_Printing's Achievements

Enthusiast

Enthusiast (6/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

10

Reputation

  1. Thomas, You rock! That code did it! Now I just need to get to the point that I totally understand how this is built so that I can get to a place where I can build this on my own! Thank you Dan and Thomas!! http://forums.pti.com/picture.php?albumid=26&pictureid=48
  2. Mr Korn, I could not see a place to view the Preview pdf in the browser as you described, but the Composition ".msg" file had the following (which to even my un-practiced eye looks a little bad) file name: "1zvnutsd.msg" (I've attached the Print Proof packaged file) Unknown Tag DataSource_FPWE ignored. Unknown Tag DataSource_FPWE ignored. Job started 07:06:06 - 1667484366. Creator: FusionPro(R) VDP Server 12.1.2 Computer Name: LVPFPI02 Current working folder: D:\US\ImageServer\bin Temporary files folder: C:\Users\Public\Documents\PTI\FusionPro\TEMP\TEMP_6624\ Template File: \\lvpfsc02.dc.pti.com\tempvol\tmp\1zvnutsd.dif Input File: \\lvpfsc02.dc.pti.com\tempvol\tmp\1zvnutsd.xml Job Config File: \\lvpfsc02.dc.pti.com\tempvol\tmp\1zvnutsd.cfg Rule "KeylineGraphicRULE": Function does not return a value. Composing record #1, input record 1 Font <Helvetica> is not a loaded font. Using default instead. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. Word <29> does not fit in frame after line 0. Word <39> does not fit in frame after line 0. Word <69> does not fit in frame after line 0. Word <22> does not fit in frame after line 0. Word <109> does not fit in frame after line 0. Word <99> does not fit in frame after line 0. The amount of text inserted into a flow exceeds the depth of all frames in the flow <>. Text is truncated. Job ended 07:06:06 - 1667484366. Total Job Time: Product_107_1zvnutsd_Composition_1zvnutsd.zip
  3. Mr Korn, You rock! I'm not really a coder but I'm learning as a go, and I have a lot to lear (obviously). Functions, for loops, and object definitions (lions, tigers, and bears.. Oh my!) are still "magic fairy dust" concepts at this point, so my code is way bulkier than it really needs to be. Add to that, that I'm coming from a Python environment and things get "interesting" I'm still researching the other information you suggested I look for...
  4. I am very new to JavaScript code and FusionPro and have been working to use a table to create a grid of prices. I can get the behavior I need in Acrobat/FusionPro but when the Product is imported into MarcomCentral the Product behavior is different. I need the prices to have a superscript dollar "$" sign and cents. The price also needs to center into the area it is printing without wrapping. Please see the attached screen captures and my code below (please be gentle, I'm really just learning JS) FusionPro Preview: http://forums.pti.com/picture.php?albumid=26&pictureid=46 MarcomCentral Preview: http://forums.pti.com/picture.php?albumid=26&pictureid=47 // FPTable with Vars - v04 - cat //---------------------------------------------------------------- var symbol = '<superscript>'+"$"+'</superscript>'; // Prices var col01 = symbol + Field("column01_DOLLAR") + '<superscript>' + Field("column01_CENT") + '</superscript>'; var col02 = symbol + Field("column02_DOLLAR") + '<superscript>' + Field("column02_CENT") + '</superscript>'; var col03 = symbol + Field("column03_DOLLAR") + '<superscript>' + Field("column03_CENT") + '</superscript>'; var col04 = symbol + Field("column04_DOLLAR") + '<superscript>' + Field("column04_CENT") + '</superscript>'; var col05 = symbol + Field("column05_DOLLAR") + '<superscript>' + Field("column05_CENT") + '</superscript>'; var col06 = symbol + Field("column06_DOLLAR") + '<superscript>' + Field("column06_CENT") + '</superscript>'; var col07 = symbol + Field("column07_DOLLAR") + '<superscript>' + Field("column07_CENT") + '</superscript>'; var col08 = symbol + Field("column08_DOLLAR") + '<superscript>' + Field("column08_CENT") + '</superscript>'; var col09 = symbol + Field("column09_DOLLAR") + '<superscript>' + Field("column09_CENT") + '</superscript>'; //---------------------------------------------------------------- // Table var table = new FPTable; var Tmar = 50 var Bmar = 50 var MinH = 2880 table.AddColumns(3499.2, 3499.2, 3499.2, 3499.2, 3499.2, 3499.2, 3499.2, 3499.2, 3499.2); table.AddRows(19); table.Rows[0].minHeight = MinH; table.Rows[0].Cells[0].HAlign = "Center"; table.Rows[0].Cells[0].VAlign = "Middle"; table.Rows[0].Cells[0].Margins = new FPTableMargins; table.Rows[0].Cells[0].Margins.Top = Tmar; table.Rows[0].Cells[0].Margins.Bottom = Bmar; //table.Rows[0].Cells[0].Bold="On"; table.Rows[0].CopyCells(0,1,2,3,4,5,6,7,8); table.Rows[0].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[1].minHeight = MinH; table.Rows[1].Cells[0].Margins = new FPTableMargins; table.Rows[1].Cells[0].Margins.Top = Tmar; table.Rows[1].Cells[0].Margins.Bottom = Bmar; table.Rows[1].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[2].minHeight = MinH; table.Rows[2].Cells[0].Margins = new FPTableMargins; table.Rows[2].Cells[0].Margins.Top = Tmar; table.Rows[2].Cells[0].Margins.Bottom = Bmar; table.Rows[2].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[3].minHeight = MinH; table.Rows[3].Cells[0].Margins = new FPTableMargins; table.Rows[3].Cells[0].Margins.Top = Tmar; table.Rows[3].Cells[0].Margins.Bottom = Bmar; table.Rows[3].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[4].minHeight = MinH; table.Rows[4].Cells[0].Margins = new FPTableMargins; table.Rows[4].Cells[0].Margins.Top = Tmar; table.Rows[4].Cells[0].Margins.Bottom = Bmar; table.Rows[4].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[5].minHeight = MinH; table.Rows[5].Cells[0].Margins = new FPTableMargins; table.Rows[5].Cells[0].Margins.Top = Tmar; table.Rows[5].Cells[0].Margins.Bottom = Bmar; table.Rows[5].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[6].minHeight = MinH; table.Rows[6].Cells[0].Margins = new FPTableMargins; table.Rows[6].Cells[0].Margins.Top = Tmar; table.Rows[6].Cells[0].Margins.Bottom = Bmar; table.Rows[6].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[7].minHeight = MinH; table.Rows[7].Cells[0].Margins = new FPTableMargins; table.Rows[7].Cells[0].Margins.Top = Tmar; table.Rows[7].Cells[0].Margins.Bottom = Bmar; table.Rows[7].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[8].minHeight = MinH; table.Rows[8].Cells[0].Margins = new FPTableMargins; table.Rows[8].Cells[0].Margins.Top = Tmar; table.Rows[8].Cells[0].Margins.Bottom = Bmar; table.Rows[8].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[9].minHeight = MinH; table.Rows[9].Cells[0].Margins = new FPTableMargins; table.Rows[9].Cells[0].Margins.Top = Tmar; table.Rows[9].Cells[0].Margins.Bottom = Bmar; table.Rows[9].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[10].minHeight = MinH; table.Rows[10].Cells[0].Margins = new FPTableMargins; table.Rows[10].Cells[0].Margins.Top = Tmar; table.Rows[10].Cells[0].Margins.Bottom = Bmar; table.Rows[10].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[11].minHeight = MinH; table.Rows[11].Cells[0].Margins = new FPTableMargins; table.Rows[11].Cells[0].Margins.Top = Tmar; table.Rows[11].Cells[0].Margins.Bottom = Bmar; table.Rows[11].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[12].minHeight = MinH; table.Rows[12].Cells[0].Margins = new FPTableMargins; table.Rows[12].Cells[0].Margins.Top = Tmar; table.Rows[12].Cells[0].Margins.Bottom = Bmar; table.Rows[12].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[13].minHeight = MinH; table.Rows[13].Cells[0].Margins = new FPTableMargins; table.Rows[13].Cells[0].Margins.Top = Tmar; table.Rows[13].Cells[0].Margins.Bottom = Bmar; table.Rows[13].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[14].minHeight = MinH; table.Rows[14].Cells[0].Margins = new FPTableMargins; table.Rows[14].Cells[0].Margins.Top = Tmar; table.Rows[14].Cells[0].Margins.Bottom = Bmar; table.Rows[14].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[15].minHeight = MinH; table.Rows[15].Cells[0].Margins = new FPTableMargins; table.Rows[15].Cells[0].Margins.Top = Tmar; table.Rows[15].Cells[0].Margins.Bottom = Bmar; table.Rows[15].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[16].minHeight = MinH; table.Rows[16].Cells[0].Margins = new FPTableMargins; table.Rows[16].Cells[0].Margins.Top = Tmar; table.Rows[16].Cells[0].Margins.Bottom = Bmar; table.Rows[16].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[17].minHeight = MinH; table.Rows[17].Cells[0].Margins = new FPTableMargins; table.Rows[17].Cells[0].Margins.Top = Tmar; table.Rows[17].Cells[0].Margins.Bottom = Bmar; table.Rows[17].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); table.Rows[18].minHeight = MinH; table.Rows[18].Cells[0].Margins = new FPTableMargins; table.Rows[18].Cells[0].Margins.Top = Tmar; table.Rows[18].Cells[0].Margins.Bottom = Bmar; table.Rows[18].SetContents(col01, col02, col03, col04, col05, col06, col07, col08, col09); return table.MakeTags();
  5. That works and thank you for the expansive explanation! I worked for another web-to-print solution and I totally get the need-to-fix-but-don't-wanna-break-all-the-old-stuff concept!
  6. I'm using the ToUpper() in FusionPro on variables that use the fonts Mr Eaves Mod OT-Light, and Mr Eaves Mod OT-Bold, and then the item is then moved to MarcomCentral for ordering as a versioned item. For some reason when a user enters an ampersand "&" the item prints "&AMP;" (without the quote marks). The code works fine in FusionPro. It does not seem to matter if I use straight JavaScript or the built in format Rule, the value returned is alway &AMP;. The Mr Eaves Mod OT fonts were not working well, and needed to be converted from OTF to TTF but still generate the &AMP;. If I enable the "Treat returned strings as tagged text" then any ampersand that is entered into the field does not generate on the item (i.e. it disappears) Why?
  7. Hello, and thanks in advance for any help. I'm trying to build stationary items that have addresses all over the world. The user wants to pick the continent and then have the drop down list of those locations appear. When they select the location, the address will automatically populate based on the cascading drop down UI rules in place. I made a shared library called "Continents" that includes the continents, and linked it to a drop down list (library) in Form Display. Once they select what locations they want, the appropriate list of locations will appear based on conditional visibility rules. I've tried two ways. First was to create libraries for each location and link them to a text field which is in turn used for a cascading drop down on selection change UI rule. The FusionPro template had one variable for address and one variable for city, state, and zip, so the different location libraries were all linked to the same address and city state zip libraries. Well, it would only correctly display the addresses for whatever library was attached to the first cascading drop down on selection change rule. So if US was first and active, those would work, but then EMEA would all default to the first value in the list, despite having separate drop down rules for each address. Second method was to add variables for each location in the FusionPro template, US address, EMEA address and so on, so that I could link separate location libraries to separate address libraries. Even thought it is set to suppress if empty, each address for each location is now populating, despite only selecting one in the preview. Is there something I'm doing wrong, or another methodology you would suggest to make this work? As always, there's a push to get this completed as soon as possible, so I really do appreciate any replies. Let me know if further info is needed.
  8. Acrobat 10 Fusion 9.3.15 Mac OS 10.11.6 I'm using FusionPro.Compositio.SetBodyPageUsage in combination with FusionProResource to use or not use a page and call back a resource if used. I also have an array to make each section even and then make the complete document divisible by 4. ( which works great ) My problem is I need a pretty simple rule to use a particular page only if one or more of a range of variables are used-otherwise it remains not used. (which I can do -- But it breaks my array for each section being even and the complete document divisible by 4) Here is my OnRecordStart For setpageusage and array if (Field("Opt1") != "") { FusionPro.Composition.SetBodyPageUsage("How Plan works at renewal 042821", "true"); } if (Field("Opt2") != "") { FusionPro.Composition.SetBodyPageUsage("HSA w_CYC 042825", "true"); } if (Field("Opt3") != "") { FusionPro.Composition.SetBodyPageUsage("HSA_wo_CYC 042826", "true"); } if (Field("Opt4") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights- EasyChoice A 042531", "true"); } if (Field("Filler1") != "") { FusionPro.Composition.SetBodyPageUsage("Filler1_042861", "true"); } if (Field("Filler2") != "") { FusionPro.Composition.SetBodyPageUsage("Filler2_042862", "true"); } if (Field("Filler3") != "") { FusionPro.Composition.SetBodyPageUsage("Filler3_042863", "true"); } if (Field("Opt5") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights- EasyChoice B 042532", "true"); } if (Field("Opt6") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Basic 042533", "true"); } if (Field("Opt7") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Plan 2 042536", "true"); } if (Field("Opt8") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Plan 3 042537", "true"); } if (Field("Opt9") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Plan 5 042535", "true"); } if (Field("Opt10") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Plan QDHP 042534", "true"); } if (Field("Opt11") != "") { FusionPro.Composition.SetBodyPageUsage("Highlights-Beffore Enrolling in QDHP 042827", "true"); } if (Field("Opt12") != "") { FusionPro.Composition.SetBodyPageUsage("Dental Plan divider page 042822", "true"); } if (Field("Opt13") != "") { FusionPro.Composition.SetBodyPageUsage("Dental Plan A 042543", "true"); } if (Field("Opt14") != "") { FusionPro.Composition.SetBodyPageUsage("Dental Plan B 042544", "true"); } if (Field("Opt15") != "") { FusionPro.Composition.SetBodyPageUsage("Dental Plan C 042545", "true"); } if (Field("Opt16") != "") { FusionPro.Composition.SetBodyPageUsage("Dental Plan PPO 042547", "true"); } if (Field("Opt17") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan A 042802", "true"); } if (Field("Opt18") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan B 042803", "true"); } if (Field("Opt19") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan C 042804", "true"); } if (Field("Opt20") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan D 042805", "true"); } if (Field("Opt21") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan E 042806", "true"); } if (Field("Opt22") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan F 042807", "true"); } if (Field("Opt23") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan G 042808", "true"); } if (Field("Opt24") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan H 042809", "true"); } if (Field("Opt25") != "") { FusionPro.Composition.SetBodyPageUsage("Ortho Plan I 042810", "true"); } if (Field("Opt26") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan divider page 042823", "true"); } if (Field("Opt27") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan A 042538", "true"); } if (Field("Opt28") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan B 042539", "true"); } if (Field("Opt29") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan C 042540", "true"); } if (Field("Opt30") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan D 042546", "true"); } if (Field("Opt31") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan E 042541", "true"); } if (Field("Opt32") != "") { FusionPro.Composition.SetBodyPageUsage("Vision Plan F 042542", "true"); } if (Field("Opt33") != "") { FusionPro.Composition.SetBodyPageUsage("App ******* Only 042669", "true"); } if (Field("Opt34") != "") { FusionPro.Composition.SetBodyPageUsage("App ******* and Vision 042668", "true"); } if (Field("Opt35") != "") { FusionPro.Composition.SetBodyPageUsage("App ******* and Dental 042824", "true"); } if (Field("Opt36") != "") { FusionPro.Composition.SetBodyPageUsage("App ******* Dental and Vision 042641", "true"); } var pages = 21; // Number of static pages var endPages = ['Filler3_042863','Notes Filler Page']; // Names of the Filler Pages at the end // there are four sections this is whether each section // should be odd or even var mustBeEven = [true,false]; // Sections (Named in accordance to their "filler" page) sections = { 'Filler1_042861': [ Field("Opt1"), Field("Opt2"), Field("Opt3"), ], 'Filler2_042862': [ Field("Opt4"), Field("Opt5"), Field("Opt6"), Field("Opt7"), Field("Opt8"), Field("Opt9"), Field("Opt10"), Field("Opt11"), Field("Opt12"), Field("Opt13"), Field("Opt14"), Field("Opt15"), Field("Opt16"), Field("Opt17"), Field("Opt18"), Field("Opt19"), Field("Opt20"), Field("Opt21"), Field("Opt22"), Field("Opt23"), Field("Opt24"), Field("Opt25"), Field("Opt26"), Field("Opt27"), Field("Opt28"), Field("Opt29"), Field("Opt30"), Field("Opt31"), Field("Opt32"), Field("Opt33"), Field("Opt34"), Field("Opt35"), Field("Opt36"), ], }; var isEven = function (number) { return number % 2 === 0; }; var currentSection = 0; var i; var pgCount; for (i in sections) { pgCount = 0; sections[i].filter(String).forEach(function(s){ pgCount += CreateResource(s, 'graphic').countPages; }); pages += pgCount; Print("Section processed pages " + i); Print(pgCount); var addPage = mustBeEven[currentSection] && !isEven(pgCount); addPage = addPage || (!mustBeEven[currentSection] && isEven(pgCount)); if (addPage) { FusionPro.Composition.SetBodyPageUsage(i, pages++); } currentSection++; } Print("pages:"); Print(pages); var pagesNeeded = 4 - ((pages % 4) || 4); Print("pagesNeeded"); Print(pagesNeeded); var pagesAdded = 0; while (pagesNeeded--){ FusionPro.Composition.SetBodyPageUsage(endPages[pagesNeeded%2], true); pagesAdded++; } Print("pagesAdded"); Print(pagesAdded); Here is an example of the graphic call back rule var Pic = new FusionProResource(Field("Opt12"), "graphic", "true"); if (Field("Opt12") != "") { return Pic }Any help would be greatly appreciated
  9. Thanks, sorry for the delay. This does exactly what I was trying to do: var pages = 14; // Number of static pages var endPages = ['End Filler Left','End Filler Right']; // Names of the Filler Pages at the end // Sections (Named in accordance to their "filler" page) sections = { 'Orange_Filler1': [ Field("FundCare_Orange1"), Field("Dental_Orange2"), Field("FlexSpend_Orange3"), Field("PlansWork_Orange4"), Field("HowToHSA_Orange5"), Field("ClientUpload_Orange") ], 'Green_Filler1': [ Field("ConsultPhysician_Green") ], 'Blue_Filler1': [ Field("EmpAssist_Blue1"), Field("SupportMoms_Blue2"), Field("NICU_Blue3"), Field("MatProg_Blue4") ] }; for (i in sections) { pgCount = 0; sections[i].filter(String).forEach(function(s){ pgCount += CreateResource(s, 'graphic').countPages; }); pages += pgCount; if (pgCount % 2) FusionPro.Composition.SetBodyPageUsage(i, pages++); } var pagesNeeded = 4-(pages%4 || 4); while (pagesNeeded--) FusionPro.Composition.SetBodyPageUsage(endPages[pagesNeeded%2], true); Making all sections elements of one array and using .forEach simplified it. Thanks again Step, this was extremely helpful!
  10. This is fantastic Step, thank you! There are actually 14 pages that will always be there, so if they don't add any optional sections or upload a section the two end filler pages will be added. Unfortunately I can't upload the file as is due to the nature of the material. But here's more detail: 14 static pages and 3 sections (Green, Orange, and Blue) with optional pages. Green = 1 optional section with 2 pages. Orange = 5 optional sections that are 1 page each and 1 option for uploading a PDF of varying page count. Blue = 4 optional sections that are 1 page each The Green section is simple, and this does exactly what I need for the Blue section (great idea to simply count the length of the array): The page count is now appearing in the log after I incremented the PAGECount variable, thanks! It's still all or nothing; if the array has no value the filler page won't be added, but if it has any value at all it will be added. I tried using the same logic from the Blue section by applying the modulus 2 to the Pic resource created from the array, but I'm obviously still applying something incorrectly: PAGEArray = [Field("FundCare_Orange1"), Field("Dental_Orange2"), Field("FlexSpend_Orange3"), Field("PlansWork_Orange4"), Field("HowToHSA_Orange5"), Field("ClientUpload_Orange")] var PAGECount = 0; for (i = 0 ; i < PAGEArray.length ; i++) { if (PAGEArray[i] != "") { var Pic = new FusionProResource(PAGEArray[i], "graphic", "true"); var PicPages = Pic.countPages; PAGECount += PicPages; if (PicPages % 2 > 0) { FusionPro.Composition.SetBodyPageUsage("Orange_Filler1", [color=Red]Pic.totalPages % 2[/color]); } } } Print("PAGECount is " + PAGECount) Once the Orange section is working properly it will always be an even page count at this point. So this logically looks like it should work too, but I wasn't getting any result after filling in the names of my specific unused body pages. I still have this placed in the OnRecordStart rule: I feel like this is all really close, and, the help is very much appreciated. I'll try to pay it forward when I'm able!
  11. What I need is a bit more complex than the title suggests. There are two separate sections in this book where the client can choose 1 to 5 optional pages. Each new section needs to start on the left, so if an uneven number of pages is chosen a filler page specific to that section will need placed. After that has happened the entire book (which will always be an even number of pages at this point) will need two specific pages placed at then end if it's not divisible by four for saddle stitch. I've poured over the forums and other samples I have, but just can't quite get it working. Here are some helpful posts I referenced: Inserting Multi-page PDF variable graphics Print page depending on even or odd pages I want to make an array for each of the two sections, count those pages and activate an unused body page if the count is odd. I'm using this in an OnRecordStart rule. Here's the code I've been trying to massage, taken and modified from a sample file: var counter = 0; PAGEArray = [Field("FundCare_Orange1"), Field("Dental_Orange2"), Field("FlexSpend_Orange3"), Field("PlansWork_Orange4"), Field("HowToHSA_Orange5"), Field("ClientUpload_Orange")] var PAGECount = 0; for (i = 0 ; i < PAGEArray.length ; i++) { if (PAGEArray[i] != "") { counter++; var Pic = new FusionProResource(PAGEArray[i], "graphic", "true"); var PicPages = Pic.countPages; if (PicPages % 2 > 0) { FusionPro.Composition.SetBodyPageUsage(“Orange_Filler1”, "true"); } } } But that just activates the unused body page anytime the array is true (not empty), and I can't seem to get the countPages aspect to work. When I use Print("PAGECount is " + PAGECount) and view the log, I simply get PAGECount is 0 repeated for each of the fields in the array that's populated. As far as counting the pages of each complete record and activating the two unused body pages at the end based on whether or not it's divisible by four, I was thinking along the same lines but am not sure how to include the pages from the base template in the count, the pages that aren't part of a graphic field. Any help is really appreciated, I always try to research and resolve things on my own as it really helps me learn, but I need some tutelage here and I'm running out of time. Thanks in advance! OSX 10.10.5 Acrobat 10.1.16 FusionPro 9.3.15
  12. That's the tree I was trying to bark up! I wasn't too far off, just screwed up some syntax and needed to correctly use the else if statement. It's great to see it done both ways, I can compare that to the "succinct" version from step, really helpful. Thanks!
  13. That's perfect, the simpler way I was looking for. Thanks step!
  14. Searched the forum and didn't find an example of what I'm looking for and am having trouble on my own, so here's my problem: One of three things needs to appear in a text body based on two fields (Field “A” and “B” for this example). If A is blank and B contains data, return sentence 1; if A contains data and B is blank, return sentence 2; if A and B both contain data, return sentence 3. So this part is easy enough: if (Field("A") == "") return ""; else return 'sentence 1 ' +Field("A"); The problem is sentence 3. If I use it as written above and make three rules, sentence 1 and 2 would return along with sentence 3. I’ve played with things like the below, which validates but doesn't work as intended: if ((Field("totalkwh") == null) && (Field("totaltherm") != null)) return ""; else return 'sentence 1 ' +Field("A"); Doing it as three rules also seems unnecessary, is there a way to write this into one rule? I'm still learning JavaScript so forgive me if something simple is wrong. I've tried to solve this on my own and am just not sure why it isn't working, thanks for any assistance. FusionPro 9.3.15 Acrobat 10.1.13 MacOS 10.10.2 Yosemite
×
×
  • Create New...