Jump to content

step

Registered Users - Approved
  • Posts

    962
  • Joined

Everything posted by step

  1. That's a pretty tricky one. The way I would probably do this would be using a table. That will give you more control over the spacing of the three sections, allow you to put the "stroke" underneath the title, and adjust the left margins so that all of your sections line up neatly if they flow to another line. I've attached a sample of how I would set up the template and I'll go ahead and apologize because it's a little sloppy because I just threw it together. Here's the code and what it's doing: /*================================================== // Edit your variables (All units in points) //=================================================*/ var color = "Delkor Red"; //Red color var leading = 6; // Leading var pointsize = 6; // Font size var spacing = 7; // Spacing between sections var lineOffset = 15; // 0 == baseline var frameName = "contact" // Name of the frame to display the table in var leftIndent = 3; /*================================================== // Generate the 3 sections: // Titles, Address, Numbers/Email/URL //=================================================*/ function phoneNumbers(){ var numbers = [ // Array of numbers and identifiers ["Direct",Field("Direct Phone")], ["Main",Field("Main")], ["Cell",Field("Cell")]]; numbers = numbers.filter(function(s){return Trim(s[1]);}).map(function(s,p){var r = s.join(" : ");return (!p)?'<span color="'+color+'">'+r+'</span>':r;}).join('<br>'); return numbers; } // Titles var title = [Field("Title"),Field("title 2")].filter(String).join('<br>'); title = (title) ? '<i>' + title + '</i>' : ''; // Address var address = [Field("Address"), [Field("City"),Field("St"),Field("Zip")].filter(String).join(', ').replace(/,( \d*)$/,'$1')].join('<br>'); // Numbers/Email/URL var numbers = [phoneNumbers(),Field("email 1"),"www.delkorsystems.com"].filter(String).join('<br>'); /*================================================== // Create table to display the content //=================================================*/ // Add leading to the sections var fields = [Field("Name"),title,address,numbers].filter(String).map(function(s,p){return (p) ? '<p br=false leading=' + (leading * 10) + '>' + s : s;}); // Initiate table var myTable = new FPTable; myTable.AddColumns(GetSettableTextWidth(FindTextFrame(frameName))); for (var i=0; i<fields.length; i++){ var row = myTable.AddRow(); var cell = row.Cells[0]; var content = fields[i]; var isNameLine = (!i && Field("Name")); // flag name line for color and stroke if (isNameLine){ cell.VAlign = "Bottom"; cell.SetBorders("Thin",color,"Bottom"); content = '<span color="' + color + '"><p br=false subratio="100" suboffset="'+lineOffset+'"><subscript>' + content + '</subscript></span>' } var topMargin = (isNameLine) ? 1 : (i == 1) ? (pointsize*1.5)+leading : (spacing*10); cell.Margins = {Top:topMargin, Bottom:1, Right:(leftIndent*100), Left:0} row.SetContents(content); } var table = '<z newsize="' + pointsize + '">' + myTable.MakeTags(); return table; It's creating a table that has 1 column that is as wide as the text frame that it's in, and 4 rows. The first row, contains the "Name" field. If the Name is not empty, that row will have a red border on the bottom. In order to offset the stroke, I'm actually subscripting the text so that it appears below the cell that it's in. That offset amount can be adjusted with the "lineOffset" variable to fit your font. The next three rows will be the three sections of your card if they are populated. The second row will have unique leading to compensate for the subscripted name. It's calculated in this line: var topMargin = (isNameLine) ? 1 : [color="Red"](i == 1) ? (pointsize*1.5)+leading[/color] : (spacing*10); The balance of the rows will have a top margins equal to the "spacing" variable to ensure they are all equally spaced. Again, you can adjust these variables to fit your needs. Once the table is generated, place it in a frame that's vertically aligned to the middle. bizcard.zip
  2. What version of FusionPro are you running? What version OS are you running FP on? There are ways to do this. If you want to import all of the rules from one template to another, you could do so when you're linking to you data file: FusionPro > Data Definition > Wizard... Import a data source from another document Find the .def file of the template that contains the rules you want to import Navigate "back" to link to another data file (if they are different) If you only want the OnRecordStart rule to import, delete all rules except the OnRecordStart rule, collect the job (FusionPro>Collect...), save the .def file it creates somewhere handy, and follow the above steps.
  3. Although, I'm sure that there are PTI employees who may work in Tech Support monitoring this forum, this is a community of other users of the app such as yourself. If you feel like your software isn't operating correctly, you should contact support directly (FusionProSupport@PTI.com). As I said in my previous post, it's hard to say why it isn't working for you without some sort of example of what you're working with (i.e. data file, FP template, rules, etc.). The problem could be a number of things from the rule itself, to the font, to what version of Acrobat you're running. You haven't told us the version of FusionPro you're using, what operating system you're running FP on, or what version of Acrobat you have FP installed in. All of that information can be pretty impactful – especially if you have stumbled across a bug in the software. The best location for that information is in your forum signature. To me that sounds like the field that you're passing it is not the correct length. The field that you used for the tracking number needs to be 20 characters. If you're only getting that error on the first record, perhaps you didn't check "First row contains field names" when linking to your data? With that being said, it would be easier to help you if you would collect your template and upload it to the forum for us to see exactly what you're working with. Otherwise, all we can do is guess what the problem might be rather than offer you solutions to resolve it. You collect your template by: Opening your template Click "Collect" under the "FusionPro" menu Make sure "Use ZIP file" is checked Click "Collect" If you do that, I (or someone else on the forum) would be more than happy to take a look and give you more specific feedback to help you avoid this issue in the future.
  4. There shouldn't be. That's just personal preference for me. I'm not a fan of writing the same things multiple times. I don't think that's it. The "String" function is converting the array value that's returned from the 'match' method to a string – not your input value. Your input value is already a string. What you were probably missing was the RegExp that is searching the entire field for "sunset_fade.pdf" (for example) so that if what Dan said is true and MarcomCentral is tagging that field, a match is still made. So, if your field value in Producer is "/path/to/sunset_fade.pdf" then: GetFileName("/path/to/sunset_fade.pdf") == "sunset_fade.pdf" But MarcomCentral may tag it so: GetFileName('<graphic file="/path/to/sunset_fade.pdf">') == 'sunset_fade.pdf[color="Red"]">[/color]' // [color="red"]NOT "sunset_fade.pdf"[/color] But with the RegExp the match is still made: String(GetFileName('<graphic file="/path/to/sunset_fade.pdf">).match(/(sunset_fade|waterfall|starry_sky)\.pdf/ig)) == "sunset_fade.pdf"
  5. That's not really a question I can answer for you without seeing your data. The easiest thing to do would be to link your csv file to your FusionPro template and examine the fields from there to see if it contains what you need. Alternatively, LibreOffice offers an open-sourced alternative to Excel for viewing/editing CSV files. Though simply opening the CSV in a text editor (such as Text Edit) and doing a "find" (cmd + F) for "several asterisks" (***) will probably take you straight to the OEL line in your data if it exists.
  6. Your problem sounds pretty similar to this thread. I'd bet with a few tweaks, the same solution would work for you: var header = String(GetFileName(Field("Cover Image")).match(/(sunset_fade|waterfall|starry_sky)\.pdf/ig)); var color = ''; switch (ToLower(header)){ case "sunset_fade.pdf": color = "Red"; break; case "waterfall.pdf": color = "Blue"; break; case "starry_sky.pdf": color = "Purple"; break; default: color = "Gray"; } return Resource("Backer_" + color + ".pdf");
  7. The simplest way to accomplish this would be to do this following: 1. Put all of your graphic subfolders (containing your PDFs) in one "graphics" folder and name them in accordance to the section header you want to display above them. For example: 2. Open up a text editor and paste the following code into it: #!/bin/bash echo "****\n* Drag and drop the folder containing the subfolders of your graphics\n* And press Enter\n****" read pathToPDFs dataFile=~/Desktop/data.csv echo "title,pdfs" > $dataFile IFS=$'\n' pdfs=`find $pathToPDFs -type f -name "*.pdf"`; for i in $pdfs; do subFolder=`echo $(dirname "$i")`; echo "\"${subFolder/*\//}\",\"$i\"" >> $dataFile done 3. Save that file to your desktop as "generateData.sh" 4. Open up Terminal.app and paste the following command: sh ~/Desktop/generateData.sh 5. When prompted, drag the folder containing your subfolders ("graphics" in this example) onto the terminal window and press enter. This will generate a file called "data.csv" on your desktop. If you open it you'll notice that it has two fields: "title" and "pdfs". Title is the name of the sub folder (which will be used for the section header in FP) and PDFs is the path to each of the PDFs in those subfolders. You can make edits here as needed. 6. Open FusionPro and create a text rule (make sure you edit the path of the external data file to reflect the "data.csv" file you just created on your desktop): var ex = new ExternalDataFileEx("/path/to/Desktop/data.csv", ","); var result = []; var title = ''; for (var i=1; i<=ex.recordCount; i++) { var graphic = ex.GetFieldValue(i, "pdfs"); var thisTitle = ex.GetFieldValue(i, "title"); if (thisTitle != title) { result.push(thisTitle); title = thisTitle }; result.push('<graphic file="' + graphic + '">'); } return result.join('<p>'); 7. Click "Treat returned strings as tagged text" 8. Apply that text rule to a text frame 9. Set that text frame to Overflow to new pages
  8. Becka, I think checking the "Re-evaluate this rule for every text flow" in your rule editor should give you the results you're looking for. That being said, I think Dan is right (per usual) in saying that if you know the page count is always going to be 4, you might as well have 4 body pages. You've already got a 3 page document – what's one more? But if you set it up as an overflow page in anticipation of using the same template for importing PDFs that may include more than 3 pages, you could leave what you have and add another body page to the end making your template look like: Page 1 - body; cover Page 2 - body; first inside page Page 3 - overflow Page 4 - body; last page of the PDF you overflowed. Then your overflow rule would be something like: var pdf = CreateResource('/path/to/Your.pdf','graphic'); var result = []; for (var i=1; i<pdf.countPages; i++){ pdf.pagenumber = i; result.push(pdf.content); } return result.join('<p>'); And on your 4th page, you'd have a graphic frame to return the last page of the PDF and whatever else you want on the page. Like this: var pdf = CreateResource('/path/to/Your.pdf','graphic'); pdf.pagenumber = pdf.countPages; return pdf;
  9. I think that "ITF" is an abbreviation of "Interleaved Two of Five." If that's true, an ITF-14 barcode is a form of a 2 of 5 Barcode which FusionPro has the ability to generate. So trying the generate the barcode with that built-in rule would be my first option. I doubt that the rule would generate the bearer bar but should you need it, you could just put a border around the text frame that's returning it.
  10. If your template is 2 pages and you want them side-by-side on an imposed sheet, read through this thread. If you're asking how to rotate sigs in FPImposer, set up your 2 page imposition, right-click on one of your sigs, and click "rotate 180 degrees."
  11. Hey DAVID! You could revise the function to add an extra line to "fool" TextMeasure if you really wanted to but honestly, that's probably more work than it's worth and it sounds like more of a band-aid fix than actually accessing the real issue. Without having seen your actual template file to see how you're generating that output, my assumption is that all of the content on the first page is generated by a rule (or a compilation of rules) that are being put into a single text frame that will overflow to the back. Based on that assumption, and the varying point-sizes, fonts, etc, creating a reliable way to add an extra line for padding is not as easy as getting the height of a line and padding the settable frame height constant. What you could do is something like this: function useOverFlow(frameName){ var text = FindTextFrame(frameName).content; [color="Red"]var frameHeight = (GetSettableTextHeight(FindTextFrame(frameName))*0.95);[/color] text = text.replace(/<variable name="([^"]*)">/g,function(a,b){return RuleOrField(b);}); var tm = new FusionProTextMeasure; tm.useTags = true; tm.maxWidth = GetSettableTextWidth(FindTextFrame(frameName)); tm.CalculateTextExtent(text); return tm.textHeight > frameHeight; } That's telling the function that the amount of space the frame has is 95% of its actual value. So it will think it's out of room when there is actually 5% left and trigger all of your dependent code. You could tinker with that value until you get the results you want. But if I had to pick a culprit without seeing the template/rules, I'd place the blame solely on the inline graphic file. AND I would bet money that you're creating that inline graphic with some code that looks like this: var graphic = CreateResource("/path/to/my/sig.pdf",'graphic'); Typically that is fine. If you were to just return that 'graphic' variable it would validate as 'Resource("/path/to/my/sig.pdf").' That is quite literally how TextMeasure will read that and it will return the measurement of that string rather than the height of the graphic itself. So if that's the case you have two options to get an accurate measurement of the graphic: 1. Change where you're defining the graphic to this: var graphic = CreateResource("/path/to/my/sig.pdf",'graphic').content; 2. Or add this line to the 'useOverflow' function (which will essentially do the first option for you): function useOverFlow(frameName){ var text = FindTextFrame(frameName).content; text = text.replace(/<variable name="([^"]*)">/g,function(a,b){return RuleOrField(b);}); [color="Red"]text = text.replace(/Resource\(([^\)]*)\)/g,'<graphic file=$1>');[/color] var tm = new FusionProTextMeasure; tm.useTags = true; tm.maxWidth = GetSettableTextWidth(FindTextFrame(frameName)); tm.CalculateTextExtent(text); return tm.textHeight > GetSettableTextHeight(FindTextFrame(frameName)); } I hope that helps!
  12. Regarding your color question, you can definitely do that. Just add this rule: var color = "Delkor Red"; // First Line Color var numbers = [ // Array of numbers and identifiers ["Direct",Field("direct phone")], ["Cell",Field("cell")], ["Main",Field("main")]]; numbers = numbers.filter(function(s){return Trim(s[1]);}).map(function(s,p){var r = s.join(": ");return (!p)?'<span color="'+color+'">'+r+'</span>':r;}).join('<br>'); return numbers; For the above code, I'm using a multi-dimensional array. Arrays are great for this type of scenario because of the methods available for them. Here's a quick break down of how I'm using it: As I said, the array "numbers" is a 2D array. Meaning, each position in the array is another array. The inner array contains the phone number description (Cell, Main, etc) and the second position contains the field value that corresponds to that description. Using the filter method, we can remove empty elements from the "numbers" array. This is essentially doing the same thing as "suppress if empty." Using the map method we're able to apply a function to each element in the array. The function I used basically joins the two positions in the inner array (description & number) with a colon and a space. It then checks to see if it's the first element in the array (the first number) and if it is, it applies a span tag which is making the number red. Finally, I used the join method to join all of the formatted elements with a break tag ("<br>"); If you wanted to, you could apply this logic to the entire card so that you only have one text box and one rule in your template.
  13. True – that thought crossed my mind as well. I decided against it though because: It just seemed a little silly to need two rules to format one number. Doing a string replace would remove the dots that abbreviate extensions. Which I guess really depends on whether you want phone numbers with extensions to be formatted like: "123 456 7890 ext.2089" or "123 456 7890 ext 2089" Aside from that, they are doing the exact same thing.
  14. I'm sort of surprised that's not an option in FusionPro's "Change Phone Format" rule. Well I just converted that to JavaScript and made a few edits: var number = "(111)222-3456"; // Your phone field return formatNumber(number); ////////////////////////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT BELOW THIS LINE /////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////// function formatNumber(number01){ var number01 = Trim(number01); var formatStyle01 = "$1 $2"; //simple 7 digit phone var formatStyle02 = "$1 $2 $3"; //simple 10 digit phone var formatStyle03 = "+$1 $2 $3 $4"; //10 digit phone starts with 1 var formatStyle04 = "$1 $2 $3 ext.$4"; //10 digit phone with extension var formatStyle05 = "+$1 $2 $3 $4 ext.$5"; //10 digit phone starts with 1 with extension var formatStyle06 = "$1 $2 ext.$3"; //7 digit phone with extension var pattern01 = /^(\d{3})[^\d]*(\d{4})$/; // //2201727 or 220-1727 or 220- 1727 var pattern02 = /^[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})$/; // 8002201727 or 800-220-1727 or (800)220-1727 or (800) 220-1727 var pattern03 = /^\+?(\d{1})[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})$/; // 18002201727 or 1-800-220-1727 or +1 (800) 220-1727 var pattern04 = /^[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/; // 800-220-1727 ext 12345 or (800) 220-1727 ext 12345 var pattern05 = /^\+?(\d{1})[\D]*(\d{3})[\D]*(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/; // 1-800-220-1727 ext 12345 or +1 (800) 220-1727 ext 12345 var pattern06 = /^(\d{3})[\D]*(\d{4})\D*[x#n]\D*(\d+)$/; // 2201727 ext 1234 or 220-1727 ext 1234 or 220- 1727 ext 1234 var patternEndExt = /(.)[x#n](.)/; var patternStart1 = /^[\D]*[1]/; if(number01.match(pattern01)){ number01 = number01.replace(pattern01, formatStyle01); return number01; } else if(number01.match(pattern02)){ number01 = number01.replace(pattern02, formatStyle02); return number01; } else if(number01.match(pattern03)){ if (number01.match(patternStart1)){ number01 = number01.replace(pattern03, formatStyle03); return number01; } else { return number01; } } else if(number01.match(pattern04)){ number01 = number01.replace(pattern04, formatStyle04); return number01; } else if(number01.match(pattern05)){ number01 = number01.replace(pattern05, formatStyle05); return number01; } else if(number01.match(pattern06)){ number01 = number01.replace(pattern06, formatStyle06); return number01; } else { //return "no match any pattern"; return number01; } } You could put that function in the JavaScript Globals and access it from any rule in your template or you can paste the rule as is into to use it format one number.
  15. That's definitely one way to do it. Another way would be to have separate pages in the template for each layout that you want and select the correct page based on the fields populated in the OnRecordStart rule. For example, having page 1 contain just 1 text/graphic frame, page 2 having 2 text/graphic frames, etc and setting them all to unused. Then your OnRecordStart rule would look something like: var fields = [Field("A"),Field("B"),Field("C")].filter(String).length; FusionPro.Composition.SetBodyPageUsage(fields, true); On one hand, that would enable you to preview the layouts locally without having to upload to MarcomCentral, but as you said, it could also prove challenging to maintain/edit. For that reason, my personal preference would be to have a single layout with one text frame that either returns a table or text with leading and inline graphics (as was previously mentioned). For example: var fields = [Field("A"),Field("B"),Field("C")].filter(String); var rowHeight = 7200; // 1" var graphicWidth = 7200; // 1" graphic column var textWidth = 14400; // 2" text column var graphic = '<graphic file="/path/to/myGraphic.pdf">'; var myTable = new FPTable; myTable.AddColumns(graphicWidth, textWidth); for (var i=0; i<fields.length; i++){ myTable.AddRow(); myTable.Rows[i].minHeight = rowHeight; myTable.Rows[i].SetContents(graphic, fields[i]); } return myTable.MakeTags();
  16. Your code looks like it should theoretically work assuming you're composing this on a server like has been previously mentioned. You did, however, misspell "suppress" so that's probably why your frames aren't suppressing.
  17. It won't tell you how many rows of text you have in a text frame, but the TextMeasure function will allow you to find the height (in 100th's of a point) of specified text – which is what I think you really need to determine how much space is being filled. Here's a function that would probably work for your needs: function getTextHeight(frameName){ var text = FindTextFrame(frameName).content; text = text.replace(/<variable name="([^"]*)">/g,function(a,b){return RuleOrField(b);}); var tm = new FusionProTextMeasure; tm.useTags = true; tm.maxWidth = GetSettableTextWidth(FindTextFrame(frameName)); tm.CalculateTextExtent(text); return tm.textHeight; // 7200 = 1 inch }
  18. I'm not quite sure what you're trying to achieve here, but if you want to change all of the text in the frame "Address" to "PANTONE 424 C" when the field "SizeColor" contains the word "color" somewhere in it, you can do this: OnRecordStart var field = Field("SizeColor"); var color = "PANTONE 424 C"; if (field.match(/color/)) { FindTextFrame("Address").content = '<span color="' + color +'">' + FindTextFrame("Address").content + '</span>'; } The above is essentially wrapping the entire contents of the frame with span tags. I should note: any text in that frame that previously had span tags applied to it will remain the color of their previous span tags by nature of how span tags work. Meaning, if you have JavaScript rules that are returning (span) tagged text in a color other than Pantone 424 (for example: blue), that text will remain blue. If that's the case you'd want to do a find and replace on all of your color tags in the "address" text frame and update them to Pantone 424. But that's a little more convoluted: var field = Field("SizeColor"); var color = "PANTONE 424 C"; if (field.match(/color/)) { var text = FindTextFrame("Address").content; text = text.replace(/<variable name="([^"]*)">/g, function(s,p){return FieldOrRule(p);}); text = text.replace(/(<color name=")[^"]*(">)|(<span(??!color).)*color=")[^"]*(">)/g, '$1' + color + '$2' ); FindTextFrame("Address").content = text; }
  19. Check your settings in your OnCopyfit rule. That rule sets limits on the minimum and maximum point sizes it will allow in your frames with copy fitting applied as well as magnification mins and maxes. If your text shrinks when you turn on "expand to fill," it's likely that your text was already out of those bounds: if (!Copyfit(new MagnifyAttributes("text", 25, 400, 5, 72))) ReportWarning("Could not copyfit text in flow " + FusionPro.Composition.CurrentFlow.name); The above copyfit rule allows the text to shrink down to 5pt but will not allow it to exceed 72pt. In addition to that, it allows the text to shrink down to 25% of the original size and will allow the text to grow to 400% of the original size (assuming that none of the other limits are reached). So, if your text is set to, for example, 80pt the copyfit rule will change it to 72pt. You'll just have to edit those values to fit your specific needs.
  20. I'm can't think of a good reason that an image would appear low res in a PDF but print fine in VDX format. My first suggestion, obviously, is to check the log file after composing for any indication of errors. Full disclosure: I do not have any experience with VDX format or Nexpress. But a few things come to mind: If the maps are generated by some sort of web API, the chances are that they are not CMYK format. You may want to check (and convert if necessary) that the maps are not of RGB or Index color space. If you're scaling the image in FP (fill, proportional fill, etc) that will have an affect on the resolution of the image. If you aren't downsampling the images (and none of the above apply to you), and the image only appears low-res on screen, it could have to do with how images are scaled on a retina display. It could also be a setting in Acrobat that is opening PDFs at a lower (on-screen) resolution. If the original image looks fine on-screen in Photoshop or wherever you created the image, you'd probably be safe ruling out the retina scaling. Alternatively, you could try saving your images as a PDF (rather than png) and see if that gives you a better proof file. If all else fails and the customer isn't buying that Acrobat is the culprit, just send the man a hard proof of a few "audit" records and let him see what you're seeing to put him at ease. Please let me know what you discover though. We have a job like this on the horizon.
  21. You didn't attach anything. But that's okay, it would be much easier on my eyes if you'd copy and paste the rules. Anyway, basically what the rule is saying is this: Create a resource called "[The value of the "Image code" field].pdf". Then check to see if that resource exists in a place that FP can find it. If it doesn't, return the default image. If it does, set the page number to the name of the frame it's returning the graphic for. The fact that you're always getting the default graphic leads me to believe that FP can't find the graphic you've told it to look for. Keep in mind that as I said above, you're adding ".pdf" to the end of the field value so if your field value is "image.pdf" then FP is searching for a resource called "image.pdf.pdf." You'd either need to remove the ".pdf" from the code or from the data itself. I originally did not code for the default image to return the second page. To do that try this: Pic = CreateResource(Field("Image Code") + ".pdf", "graphic", true); var result = (Pic.exists) ? Pic : Resource("Cart 4247 PM8945.pdf"); result.pagenumber = FusionPro.Composition.CurrentFlow.name; return result; If you have the extension included in your field value do this: Pic = CreateResource(Field("Image Code"), "graphic", true); var result = (Pic.exists) ? Pic : Resource("Cart 4247 PM8945.pdf"); result.pagenumber = FusionPro.Composition.CurrentFlow.name; return result;
  22. Okay. When I created an Insert Picture Rule that was the code that was generated for me. You don't need it – it's basically there to handle other file types and whatnot. Anyway, Insert the code I previously mentioned (in red) above the "return Pic" line in your code, select that check box at the top of the rule editor and you should be all good: Pic = CreateResource(Field("Image Code") + ".pdf", "graphic", true); if (Pic.exists){ [color="Red"]Pic.pagenumber = FusionPro.Composition.CurrentFlow.name;[/color] return Pic; } else { return Resource("Cart 4247 PM8945.pdf"); } You'll need to double check to make sure I wrote your default image name ("Cart 4247 PM8945.pdf") correctly. I had a pretty difficult time reading it from your screen grab.
  23. 1. Name your graphic frames by the page number that you'd like to display in them (i.e. frame name: "1" will display page 1, frame name: "2" will display page 2). 2. Open your list of rules 3. Double click "Insert Picture Rule" and click "Convert to JavaScript" 4. Check the check box at the top beside "Re-evaluate this rule for every graphic frame" 5. Edit the code to below. You only need to add the line I've added (highlighted in red) the rest of the code should match yours and I've only included it for context. temp = ''; var_extension = ''; has_extension = ''; if (Var3 == "") Var3 = Var3; else { if (FusionPro.isMac) Var3 = Var3 + ":"; else Var3 = Var3 + "\\"; } for (i=0; i<Field(Var1).length; i++) { temp = Mid(Field(Var1), Field(Var1).length-i,1); var_extension = temp + var_extension; var_extension = ToLower(var_extension); if(var_extension == ".png" || var_extension == ".pdf" || var_extension == ".gif" || var_extension == ".eps" || var_extension == ".tif" || var_extension == ".tiff" || var_extension == ".jpg" || var_extension == ".jpeg") { has_extension = "true"; i=Field(Var1).length; } else has_extension = "false"; } if(has_extension == "true") Pic = CreateResource(Var3 + Field(Var1), "graphic", true); else { if(Var2 == ".jpg") { Pic = CreateResource(Var3 + Field(Var1) + ".jpeg", "graphic", true); if (Pic.exists) Pic = Pic; else Pic = CreateResource(Var3 + Field(Var1) + ".jpg", "graphic", true); } if(Var2 == ".tif") { Pic = CreateResource(Var3 + Field(Var1) + ".tif", "graphic", true); if (Pic.exists) Pic = Pic; else Pic = CreateResource(Var3 + Field(Var1) + ".tiff", "graphic", true); } if(Var2 == ".png" || Var2 == ".pdf" || Var2 == ".eps" || Var2 == ".gif") { Pic = CreateResource(Var3 + Field(Var1) + Var2, "graphic", true); } } if (Pic.exists) { [color="Red"]Pic.pagenumber = FusionPro.Composition.CurrentFlow.name;[/color] return Pic; } else { return CreateResource(Var3 + Var4, "graphic", true); }
  24. What works? What code did you use? I'm not really sure what you're asking but the last block of code I posted (see below) adds 5 non-breaking spaces and a bullet to the start of every line so they shouldn't be "defaulting back to the left margin." Unless, of course, the new lines in that field are being delimited by something other than a paragraph tag ("<p>"). But either way it's really hard to say without seeing what your data looks like.
×
×
  • Create New...