Jump to content

scotts

Registered Users - Approved
  • Posts

    46
  • Joined

Everything posted by scotts

  1. I do not see anything that jumps out to me. But a question I have, did you 'compose' this file before you 'collect'? That might have something to do with it. I was test my jobs that way, before I upload them. If that doesn't fix it, I would try creating a new product in MDSF and see if this one will preview correctly. It might have something to do with uploading a newer Fusion file and then an older one. The system might be confused.
  2. Thank jwhittaker for taking at crack at it. I cannot have the table go to another page, so that will not work for me. But I did create a solution. And here it is. I created the headers as separate text frames and suppressed them by default and used an 'OnRecordStart' rule to unsuppress them if needed. if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } //Get a count of the total number of records in the external data file numRecsExtDF = externalDF.recordCount; /*============================================================================= || Create arrays to hold values that match the CID of the client's record ||=============================================================================*/ var clientMatch = []; // Step through the external data file and push matches into their respective variables if there is a match for (var i=1; i <= numRecsExtDF; i++) { if (externalDF.GetFieldValue(i, 'Constituent ID') == Field("Constituent ID")) { clientMatch.push(externalDF.GetFieldValue(i, 'Constituent ID')); } } /*============================================================================= || Determine if Header Text Frames need to be hidden ||=============================================================================*/ var Header1 = FindTextFrame("Header_1"); var Header2 = FindTextFrame("Header_2"); var Header3 = FindTextFrame("Header_3"); Header2.suppress = true; Header3.suppress = true; if (clientMatch.length >16) { Header2.suppress = false; Header3.suppress = false; } if ((clientMatch.length <=16) && (clientMatch.length >=9)) { Header2.suppress = false; Header3.suppress = true; } And then my table would span through the three text frames just fine with the "headers" being "turned" on if needed. Here's the 'Header Table Rule'. /*============================================================================= || Create the table ||=============================================================================*/ new FPTable; var myTable = new FPTable; myTable.AddColumns(5900, 7300); // 1 inch = 7200 pts myTable.AddRows(1); // HEADER ROW FORMATTING myTable.Rows[0].Cells[0].Font = "Arial"; myTable.Rows[0].Cells[0].PointSize = "11"; myTable.Rows[0].Cells[0].TextColor = "Black"; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 20; myTable.Rows[0].Cells[0].Margins.Bottom = 20; myTable.Rows[0].Cells[0].HAlign = "Center"; myTable.Rows[0].Cells[0].VAlign = "Center"; myTable.Rows[0].CopyCells(0, 1); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].SetContents("Date", "Amount"); return myTable.MakeTags();And here's my actual table rule for the external data. I left the header row in there, because I couldn't figure out how to remove it and still get the rule to validate it. And just adjusted my next two text frames without the header to line up with my first data row. Simple enough. if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } //Get a count of the total number of records in the external data file numRecsExtDF = externalDF.recordCount; /*============================================================================= || Create arrays to hold values that match the CID of the client's record ||=============================================================================*/ var clientMatch = []; var dateMatch = []; var amtMatch = []; // Step through the external data file and push matches into their respective variables if there is a match for (var i=1; i <= numRecsExtDF; i++) { if (externalDF.GetFieldValue(i, 'Constituent ID') == Field("Constituent ID")) { clientMatch.push(externalDF.GetFieldValue(i, 'Constituent ID')); dateMatch.push(externalDF.GetFieldValue(i, 'Gift Date')); amtMatch.push(externalDF.GetFieldValue(i, 'Gift Amount')); } } /*============================================================================= || Create the table ||=============================================================================*/ new FPTable; var myTable = new FPTable; myTable.AddColumns(5900, 7300); // 1 inch = 7200 pts // myTable.AddRows(clientMatch.length+2); // add 2 additional rows (Header and summary lines) myTable.AddRows(clientMatch.length+1); // acutal rows needed // HEADER ROW FORMATTING myTable.Rows[0].Cells[0].Font = "Arial"; myTable.Rows[0].Cells[0].PointSize = "11"; myTable.Rows[0].Cells[0].TextColor = "Black"; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 20; myTable.Rows[0].Cells[0].Margins.Bottom = 20; myTable.Rows[0].Cells[0].HAlign = "Center"; myTable.Rows[0].Cells[0].VAlign = "Center"; myTable.Rows[0].CopyCells(0, 1); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].SetContents(" ", " "); // interate through the length of the arrays (data matches from external data file) and create rows for (var i=1; i<=clientMatch.length; i++) { // TABLE CONTENT FORMATTING for date and amount values myTable.Rows[i].Cells[0].Font = "Arial"; myTable.Rows[i].Cells[0].PointSize = "9"; myTable.Rows[i].Cells[0].HAlign = "Center"; myTable.Rows[i].Cells[0].VAlign = "Middle"; myTable.Rows[i].Cells[0].Margins = new FPTableMargins; myTable.Rows[i].Cells[0].Margins.Top = 20; myTable.Rows[i].Cells[0].Margins.Bottom = 20; myTable.Rows[i].CopyCells(0,1); // Apply the same formating to each cell in this row // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS myTable.Rows[i].SetContents(dateMatch[i-1], amtMatch[i-1]); } return myTable.MakeTags(); And again, I've included my updated sample files for anyone to see. (PDF, data and external data) Archive.zip
  3. Sorry I did not post the code. Here it is, now that I've made some progress. I know I can only have my header and than 8 rows after that. So I'm trying to manually put in my breaks so I can get the headers when the table flows to another text frame. But I have found that when I do it the way I have it, I am losing one record of data. if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } //Get a count of the total number of records in the external data file numRecsExtDF = externalDF.recordCount; /*============================================================================= || Create arrays to hold values that match the CID of the client's record ||=============================================================================*/ var clientMatch = []; var dateMatch = []; var amtMatch = []; // Step through the external data file and push matches into their respective variables if there is a match for (var i=1; i <= numRecsExtDF; i++) { if (externalDF.GetFieldValue(i, 'Constituent ID') == Field("Constituent ID")) { clientMatch.push(externalDF.GetFieldValue(i, 'Constituent ID')); dateMatch.push(externalDF.GetFieldValue(i, 'Gift Date')); amtMatch.push(externalDF.GetFieldValue(i, 'Gift Amount')); } } /*============================================================================= || Create the table ||=============================================================================*/ new FPTable; var myTable = new FPTable; myTable.AddColumns(5900, 7300, 3600); // 1 inch = 7200 pts // myTable.AddRows(clientMatch.length+2); // add 2 additional rows (Header and summary lines) myTable.AddRows(clientMatch.length+1); // add 1 additional rows (Header) if (clientMatch.length+1 <= 8) { // Table for records with less than 8 gifts. // HEADER ROW FORMATTING myTable.Rows[0].Cells[0].Font = "Book Antiqua"; myTable.Rows[0].Cells[0].PointSize = "11"; myTable.Rows[0].Cells[0].TextColor = "Black"; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 20; myTable.Rows[0].Cells[0].Margins.Bottom = 20; myTable.Rows[0].Cells[0].HAlign = "Center"; myTable.Rows[0].Cells[0].VAlign = "Center"; myTable.Rows[0].CopyCells(0, 1, 2); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].SetContents("Date", "Amount", "i"); // interate through the length of the arrays (data matches from external data file) and create rows for (var i=1; i<=clientMatch.length; i++) { // TABLE CONTENT FORMATTING for date and amount values myTable.Rows[i].Cells[0].Font = "Book Antiqua"; myTable.Rows[i].Cells[0].PointSize = "9"; myTable.Rows[i].Cells[0].HAlign = "Center"; // myTable.Rows[i].Cells[0].VAlign = "Middle"; myTable.Rows[i].Cells[0].Margins = new FPTableMargins; myTable.Rows[i].Cells[0].Margins.Top = 20; myTable.Rows[i].Cells[0].Margins.Bottom = 20; myTable.Rows[i].CopyCells(0,1,2); // Apply the same formating to each cell in this row // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS myTable.Rows[i].SetContents(dateMatch[i-1], amtMatch[i-1], [i]); } } else if ((clientMatch.length+1 >= 9) && (clientMatch.length+1 <= 16)) { // Table for records with more than 8 gifts but less than 16. // HEADER ROW FORMATTING myTable.Rows[0].Cells[0].Font = "Book Antiqua"; myTable.Rows[0].Cells[0].PointSize = "11"; myTable.Rows[0].Cells[0].TextColor = "Black"; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 20; myTable.Rows[0].Cells[0].Margins.Bottom = 20; myTable.Rows[0].Cells[0].HAlign = "Center"; myTable.Rows[0].Cells[0].VAlign = "Center"; myTable.Rows[0].CopyCells(0, 1, 2); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].SetContents("Date", "Amount", "i"); // interate through the length of the arrays (data matches from external data file) and create rows for (var i=1; i<=clientMatch.length; i++) { // TABLE CONTENT FORMATTING for header myTable.Rows[9].Cells[0].Font = "Book Antiqua"; myTable.Rows[9].Cells[0].PointSize = "11"; myTable.Rows[9].Cells[0].TextColor = "Black"; myTable.Rows[9].Cells[0].Margins = new FPTableMargins; myTable.Rows[9].Cells[0].Margins.Top = 20; myTable.Rows[9].Cells[0].Margins.Bottom = 20; myTable.Rows[9].Cells[0].HAlign = "Center"; myTable.Rows[9].Cells[0].VAlign = "Center"; myTable.Rows[9].CopyCells(0, 1, 2); // Apply the same formating to each cell in this row myTable.Rows[9].SetContents("Date", "Amount", "i"); // TABLE CONTENT FORMATTING for date and amount values myTable.Rows[i].Cells[0].Font = "Book Antiqua"; myTable.Rows[i].Cells[0].PointSize = "9"; myTable.Rows[i].Cells[0].HAlign = "Center"; // myTable.Rows[i].Cells[0].VAlign = "Middle"; myTable.Rows[i].Cells[0].Margins = new FPTableMargins; myTable.Rows[i].Cells[0].Margins.Top = 20; myTable.Rows[i].Cells[0].Margins.Bottom = 20; myTable.Rows[i].CopyCells(0,1,2); // Apply the same formating to each cell in this row // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS myTable.Rows[i].SetContents(dateMatch[i-1], amtMatch[i-1], [i]); } } else if (clientMatch.length+1 >= 17) { // Table for records with more than 16 gifts. // HEADER ROW FORMATTING myTable.Rows[0].Cells[0].Font = "Book Antiqua"; myTable.Rows[0].Cells[0].PointSize = "11"; myTable.Rows[0].Cells[0].TextColor = "Black"; myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 20; myTable.Rows[0].Cells[0].Margins.Bottom = 20; myTable.Rows[0].Cells[0].HAlign = "Center"; myTable.Rows[0].Cells[0].VAlign = "Center"; myTable.Rows[0].CopyCells(0, 1, 2); // Apply the same formating to each cell in this row // HEADER ROW CONTENT myTable.Rows[0].SetContents("Date", "Amount", "i"); myTable.Rows[9].SetContents("Date", "Amount", "i"); myTable.Rows[18].SetContents("Date", "Amount", "i"); // interate through the length of the arrays (data matches from external data file) and create rows for (var i=1; i<=clientMatch.length; i++) { // TABLE CONTENT FORMATTING for header // myTable.Rows[9].Cells[0].Font = "Book Antiqua"; // myTable.Rows[9].Cells[0].PointSize = "11"; // myTable.Rows[9].Cells[0].TextColor = "Black"; // myTable.Rows[9].CopyCells(0, 1); // Apply the same formating to each cell in this row // myTable.Rows[18].Cells[0].Font = "Book Antiqua"; // myTable.Rows[18].Cells[0].PointSize = "11"; // myTable.Rows[18].Cells[0].TextColor = "Black"; // myTable.Rows[18].CopyCells(0, 1); // Apply the same formating to each cell in this row // TABLE CONTENT FORMATTING for date and amount values myTable.Rows[i].Cells[0].Font = "Book Antiqua"; myTable.Rows[i].Cells[0].PointSize = "9"; myTable.Rows[i].Cells[0].HAlign = "Center"; // myTable.Rows[i].Cells[0].VAlign = "Middle"; myTable.Rows[i].Cells[0].Margins = new FPTableMargins; myTable.Rows[i].Cells[0].Margins.Top = 20; myTable.Rows[i].Cells[0].Margins.Bottom = 20; myTable.Rows[i].CopyCells(0,1,2); // Apply the same formating to each cell in this row // CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS myTable.Rows[i].SetContents(dateMatch[i-1], amtMatch[i-1], [i]); } } return myTable.MakeTags();
  4. I'm new to tables and the forum is a great help. Thank you to everyone that posts. I have a project that I'm stuck on. A letter showing giving amounts in a small space using external data (which is also a first for me). But some of the data is too much to fit in the space so I need the table to start over with the header in a new text frame or add on to the table columns. Not sure how to do either. I have attached a sample document with sample data of what I'm working with and what I'm trying to do. I have left all the comments of the table rule in there until I have figured it all out, and so I can use this job as a sample for later. I have attache a zip of the PDF and CSV files. Along with a screenshot of the what it should kind of look like in the end. Granted it is using the same data in all 3 text frames, but that is only because I don't know how to get it to do it, yet. I'm on a Mac 10.13.6 using FP Creator v10.0.3. Archive.zip Table_Sample_Screenshot.pdf
  5. Dan, can you take a FP v11 job, and open it in FP v10 without any issues? Or vise-versa?
  6. I've searched the forum, and found an answer from 2017. Wondering if there has been an update to FPImposer. I'm thinking it still is a no, but just checking. Can it adjust for creep or shingling on saddle stitched jobs? Running FPImposer 10.0.3.
  7. Might want to check on how many fonts you have loaded. If you have around 500 loaded, that could be part of your problem. Something to look at.
  8. Dan, I'm just trying to match the design of what the customer has originally done. And when they did the stroke in Illustrator, it looks fine on both the '$' and the number. But when done in FP, the number looks good, but the $'s stroke looks almost non existent. I have included the collection of the template, so you can see all aspects. SnapSign.zip
  9. I have a customer that wants a black 4pt stroke on their white text for pricing on their products. I can get the stroke to work just fine through the 'Advance Text Options', or through the code <stroke>, but when I <superscript> the dollar sign and cents, the stroke becomes very thin. Is this just a limitation of FP, or is there another what of me doing this that I haven't thought of yet? Any help would be appreciated. iMac running 10.13.6 w/32G RAM, Acrobat X 10.1.10 (because I still like the interface, but also tried DC) and FusionPro 10.0.3 (because of integration with MDSF from EFI). I am just testing "Option1" right now to get things correct. Once it is, I will make Option2 and Option3 match Option1. switch (Field("Daily").toLowerCase()) { case "Option1".toLowerCase(): return "<span>" + '<f name="Avenir Next Bold">' + '<z newsize="168.0">' + "<tracking newsize=-20>" + "<superscript>" + '<stroke color="Black" width="30000">' + "$" + "</stroke>" + "</superscript>" + "</tracking>" + '<stroke color="Black" width="300">' + "7" + "</stroke>" + "</f>" + "</span>"; case "Option2".toLowerCase(): return "<span>" + '<f name="Avenir Next Bold">' + '<z newsize="168.0">' + "<tracking newsize=-20>" + "<superscript>" + "$" + "</superscript>" + "</tracking>" + "7" + "</f>" + "</span>"; case "Option3".toLowerCase(): return "<span>" + '<f name="Avenir Next Bold">' + '<z newsize="168.0">' + "<tracking newsize=-20>" + "<superscript>" + "$" + "</superscript>" + "</tracking>" + "8" + "</f>" + "</span>"; default: return ""; }
  10. Ste, Thank you very much for all your post, but especially on this post. I would not have been able to achieve my goals on a project without your guidance. You are a wealth of knowledge.
  11. Just looking at this part, your variable "Background" is always going to equal the Field("Background"), so the switch will never work. Let's say Field("Background") is equal to "18x12", and you are trying to make the variable to equal the return of your 'if' statement, correct. You could change your variable to be... var Style1A = "Style 1 18x12"; var Style1B = "Style 1 18x12"; And your return to be... if (Field("Years of Service") >=1 && Field("Years of Service")<= 5) + Field("Background") == "Style 1"; return Style1A; if (Field("Years of Service") >=10 && Field("Years of Service")<= 15) + Field("Background") == "Style 1"; return Style1B; And your SetBodyPageUsage to be...without the switch case "Style1A": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",true); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); Hope this helps.
  12. I've had this happen many times to me too. A simple test is to load the fonts through FontBook, and not using InDesign's feature of putting them in a folder called "Document fonts" at the same level as your document. And then make sure your fonts folder is NOT called "Document fonts". Now open your InDesign, do you get a font error there now? Sometimes I do, sometimes I don't. Either way, you may just have to relink the way FusionPro sees the name font, as opposed to the way InDesign sees the name of the font. Eventhough they very may well be the same. Good luck.
  13. If the TypeKit fonts were loaded correctly in your system, then you should be able to use them in other apps too. Have you tired other apps to see if you can use them there. If not, you might have an issue with the Creative Cloud.
  14. I've had luck. You have to load the font(s) you want through Adobe's Cloud service, by 'syncing' the fonts. Once that is done, then you can "Load Fonts" in FusionPro.
  15. I will say, a majority of the solutions you will find are a lot easier than you think. I would say 75%, I, myself, overthink the problems, and then find a very simple solution to the problem. Just letting you know, you are not alone.
  16. Why don't you use "unused" pages, and have them be turned on via an "OnRecoredStart" rule based on the language translation (assuming that is a field in your data). I use this sort of thing all the time. Works great.
  17. Dan, thanks for the guidance. But this is what I wanted to do. I am not looking for line endings, but character counts of possible lines to make it work. And with some of your hints I found the answer I was looking for. My code was a bit off. I used BBEdit a lot and the Grep searching which is very close to Javascript, but in this case it wasn't. You will see what I did to make it work below. Pretty sweet (showing my age). Thanks again Mr. Korn //Before return Field("Desc3").replace(/(.){18}(.){55}(.)*/, "$1")"; //Before return Field("Desc3").replace(/(.{18})(.{55})(.*)/, "$1");
  18. Dan, Here is a your sample file modified to try and show what I'm trying to accomplish. It includes the PDF and a TXT file. I hope this helps to understand my cause. Thanks CopyFit_Test.zip
  19. Dan, sorry but that will not work for this, because each set of lines need to be a different font size, and that last bit of text is a different font. And this is all created from a single text field. I needed to break apart the text so that the first part would be a larger font, and the second couple of lines a bit smaller, and the rest a different font and size. But what I finally did, since I was making for DigitalStorefront, was to make that one field into three, and then three different text frames. Not as nice as I wanted, but does work. I will still have to play around with it, because now I want to figure it out. I was thinking of still having one field, but with three text frames, and then a rule to select the first 18 characters of the field for the first frame, and then the next 55 characters starting at character 19 for the second frame, and then rest in the last frame. But when I was working on it, I just couldn't get it to work. //First frame return Field("Desc3").replace(/(.){18}(.){55}(.)*/, "$1")"; //Second frame return Field("Desc3").replace(/(.){18}(.){55}(.)*/, "$2")"; //Third frame return Field("Desc3").replace(/(.){18}(.){55}(.)*/, "$3")";
  20. I could use some help on a project. I think I should be able to use TextMeasure to make this happen, but it will be the first time to use it, and I'm stuck. I'm sure I'm overthinking it. And I'm just stuck, and don't know where/how to begin. The field that this will be coming in as, will be a text field that will have different lengths of data, and I would like to be able to adjust the text font size, when it composes to match the attached graphic sample. So it will have to make adjustments twice to the data. But I've been beating my head against the wall and looking on the forum and can't find anything that will at least get me started. I'm just looking for a nudge.
  21. Don't feel bad. I feel the same way, when I post. I'm sure there are many others who do too.
  22. I know I'm late to the party, but thought I would still share too. When I have a job that has multiple pages, front and back for specific versions in one file. I set all the pages to be unused, and then I name the what ever they are called in the data file (usually called 'Key Code' field) with either '_Front' or '_Back' depending on what they are. Then I use this code as an OnRecordStart-BodyPageUsage Rule: FusionPro.Composition.SetBodyPageUsage(Field("Key Code")+"_Front", true); FusionPro.Composition.SetBodyPageUsage(Field("Key Code")+"_Back", true);This way, there is no IF/Then else statements or switches. It either works (99% of the time, or it doesn't. You can change the '_Front' and '_Back' to whatever you want, you just need to be consistent for all your pages.
  23. After seeing Dan's post about third party font apps in a different post a while ago, I can tell you that since using Mac's Font Book for my fonts, I've had much better luck with fonts and Fusion Pro. Just thought you might like to hear it from someone in the trenches.
  24. I know I am waaay late to the party, but I just ran across this too. I did the steps Dan suggested about "you might need to enable Unicode output by uncheck the "Limit processing to Latin-1/Mac Roman text" box on the Advanced tab of the Composition Settings dialog. Like I said earlier....". But that did not help. First I'm on a Mac, and what worked for me, was to open my data file (I use BBEdit), and save it with "Classic Mac (CR) Line breaks" and "Western (Mac OS Roman) Encoding". Once I did that, it worked like a charm. And the encodings were all there.
  25. Tim, thanks for sharing. Been quite a while since you posted it, but it was just what I needed for a project I'm working on.
×
×
  • Create New...