Jump to content

step

Registered Users - Approved
  • Posts

    962
  • Joined

Everything posted by step

  1. You can use this to determine the number of break tags in a string: var str = Rule("Your format rule"); // Titles return str.match(/\<br\>/g).length; Or you could assign that to a variable and move your static text like so: var titles = Rule("Your format rule"); var breaks = titles.match(/\<br\>/g).length; // Number of breaks var email = "<br>static@emailaddress.com"; return (breaks < 4) ? title + email : title + email.replace("<br>","<br><br>");
  2. Oh gotcha. I would give support a call. I have not experienced that issue.
  3. What does the log file say when it fails?
  4. Does the job fail as soon as you submit it or does it compose some records and then fail? The former would lead me to believe that it's an issue with Producer (though I wouldn't think file size would have any impact on that) while the latter would hint at not having enough RAM on the Producer computer to compose the job. You could also split the data files into chunks and compose that way.
  5. ok... Try this then: var outputName = "FORM-" + GetFileName(FusionPro.Composition.inputFileName).replace(/^[^_]*_(\d+_\d*).*$/g,'$1') + "." + FusionPro.Composition.outputFormatExtension;
  6. It appears you put a space between the "m" and "atch"
  7. var outputName = "FORM-" + GetFileName(FusionPro.Composition.inputFileName).match(/\d+_\d+/g)[0] + "." + FusionPro.Composition.outputFormatExtension;
  8. When defining your data source: "Specify a data source definition" Click Next "None" Click Next Click Finish Create an OnJobStart callback rule and put this in it: FusionPro.Composition.composeAllRecords = false; FusionPro.Composition.endRecordNumber = 100; // number of copies Create a blank text rule that will return the sequence number and then put it in a text frame on the first page: return FormatNumber("000",CurrentRecordNumber());
  9. You get that error when trying to validate the rule or when you run the composition?
  10. You can try this: var imposheet = FusionPro.Composition.impositionSheetNumber; var numOfBacks = 7; // Total number of backs you want to pull in var back = (imposheet%numOfBacks == 0) ? numOfBacks : imposheet%numOfBacks; return Resource("B " + back + ".pdf");
  11. Can you be more specific about how you'd use the ticket number to call the correct back? What numbers correlate with what back?
  12. var number = 100000; var significance = 12; return Math.floor(number / significance) * significance;
  13. I would put the code mentioned in my previous post in a graphic rule and apply it to a graphic frame on the first page. And just add this to the OnRecordStart rule: FusionPro.Composition.repeatRecordCount = 1124;
  14. Oh I see. Maybe try repeating the record 1,124 times (the number of pages in your PDF) and then defining the page number of the PDF by the repeat record number? Like this: var pdf = CreateResource("yourPDFfile.pdf"); pdf.countPages; pdf.pagenumber = FusionPro.Composition.repeatRecordNumber; return pdf;
  15. Don, take a look at this thread. I think it sounds like what you're trying to accomplish.
  16. Edit the 'var seq' line to look like this: var seq = FormatNumber("00",batch) + FormatNumber("000",chunkSeq);
  17. Someone else can probably post a cleaner way to do this, but I think this would work for you: var chunkHeight = 251; // Number in a chunk var rec = FusionPro.Composition.inputRecordNumber; var batch = (rec%chunkHeight == 0) ? Math.floor(rec/chunkHeight) : Math.floor(rec/chunkHeight) + 1; var chunkSeq = (rec%chunkHeight == 0) ? chunkHeight : rec%chunkHeight; // Format chunkSeq and prepend batch number var seq = batch + FormatNumber("000",chunkSeq); return seq;
  18. Sure. You just need to tweak your syntax a little: if (op1!="") { FindTextFrame("abc").content = op1; }
  19. The irony of your user name and the problem expressed in this post is overwhelming. Do you have "use legacy line leading" checked in the global settings of the paragraph settings?
  20. I don't think there is a way for FusionPro to mirror the text. I think you could create a font in a program such as Fontographer and mirror the letters. Then you could reverse the string and return it in your custom font using the following code: var str = Field("YOUR FIELD"); return str.split("").reverse().join("");
  21. Couldn't you just get rid of that function and use the "smallcap" tags? for (var i in FusionPro.Fields) FusionPro.Composition.AddVariable(i, Field(i).replace(/(\d+)/g,'<smallcap>$1</smallcap>'), true);
  22. Can you post a sample data file?
  23. Couple of issues I see here. First, you are setting the value of the "WelcomePackageCode" to all lowercase and then searching it for uppercase letters. Secondly, I think you also need to escape spaces in your path. I think you could simplify your code to look like this: outpath = "c:\\Files\\7-7\ to\ Print\\" + Field("WelcomePackageCode") + "\\"; filename = Field("WelcomePackageCode") + " " + Field("LastnameRP") + "_" + Field("firstnameRP") + " " + Field("SubscriberID"); outfile = outpath + filename; if (FieldChanged("WelcomePackageCode")) FusionPro.Composition.OpenNewOutputFile(outfile + "." + FusionPro.Composition.outputFormatExtension);
  24. Several ways you could accomplish this. Probably the simplest solution: In the text editor window, highlight the paragraph you wish to suppress and click the "paragraph" button, check the "Suppress if" box, and select "Containing empty variables" from the drop-down menu.
  25. Are you using FP 8.1 or later? If not, that won't work. If you are, make sure that the frame you want to fill the color with is called "Box" and make sure that you have that code in an OnRecordStart Callback rule.
×
×
  • Create New...