Brad Sawatzky Posted January 3, 2013 Share Posted January 3, 2013 I'm currently working on a business card template that uses a rule I found on this forum to horizontally scale my "Title" field, and I've run into a problem with ampersands. The rule looks like this: return '<magnify type=setwidth factor=91.72>' + NormalizeEntities (Field("Title")) + '</magnify>'; Everything composes correctly, but when I load it to my DSF and test it, ampersands in my "Title" field return: "Barrister & Solicitor" I have "Treat returned strings as tagged text" box checked, but I'm not sure how to tweek the rule to return "Barrister & Solicitor" Any assistance would be appreciated. Thanks, Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 3, 2013 Share Posted January 3, 2013 The DSF is using tagged markup input, which already has entity replacements, while your local composition uses flat file input. The way to resolve this is with the TaggedDataField function, like so: return '<magnify type=setwidth factor=91.72>' + TaggedDataField("Title") + '</magnify>'; Quote Link to comment Share on other sites More sharing options...
Brad Sawatzky Posted January 8, 2013 Author Share Posted January 8, 2013 Hi Dan, I tried replacing my rule with the one you tweeked for me but when I validate the rule, I get "ReferenceError: TaggedDataField is not defined" I've played around with it, but I'm just not sure how to proceed. Thanks Dan, Quote Link to comment Share on other sites More sharing options...
esmith Posted January 8, 2013 Share Posted January 8, 2013 If you open a rule (any rule) and find the Building Blocks dialog window, then go to the "Functions" tab and locate the "FusionPro" group do you see the "TaggedDataField" function listed? If it is not there, then it is not compatible with your version of the software. Dan may not have noticed that you were using an older version. Quote Link to comment Share on other sites More sharing options...
Brad Sawatzky Posted January 8, 2013 Author Share Posted January 8, 2013 Hey Eric, Took a look under Functions, and the "TaggedDataField" function isn't listed. Also noticed my signature is out of date. I'm using FusionPro 6.2P1a, and Acrobat 9.5.2. Any idea how I might remedy the problem with 6.2P1a? Thanks, Quote Link to comment Share on other sites More sharing options...
esmith Posted January 8, 2013 Share Posted January 8, 2013 Maybe this will work: return '<magnify type=setwidth factor=91.72>' + Field("Title").replace(/&(?!\w+;)/g,"&") + '</magnify>'; The replace is looking for any occurrence of an ampersand that is not followed by a string of characters and a semicolon (an existing entity) and replacing it with the ampersand entity. Don't forget to remove the "NormalizeEntities" function that you had in your original code and leave the "Treat returned strings as tagged text" box checked. Quote Link to comment Share on other sites More sharing options...
Brad Sawatzky Posted January 10, 2013 Author Share Posted January 10, 2013 Hi Eric, Finally got a chance to sit down and give it a try, and it works like a charm. You're a gentleman Eric, I'm now renaming all my kids after you. Thanks!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.