Jump to content

jmerrick0657

Registered Users - Approved
  • Posts

    39
  • Joined

Everything posted by jmerrick0657

  1. I'm trying to allow the user to select the label for a phone number they want to appear in a QR code using a field, however I'm having trouble getting the QR code to use the contents of the field. The entire rule I'm using is below for reference, however the line I'm trying to figure out is : "TEL;type=Toll Free": Field("TollFree"), This seems to work fine and displays the label as Toll Free, then the number correctly. However I'm trying to change it to something like this: "TEL;type=' + Field('C1Label') + '": Field("TollFree"), With that it is displaying the literal string ' + Field('C1Label') + ' I'm guessing it has to do with using different single / double quotes to delineate what should be interpreted as JavaScript vs displayed as literal text but I can't quite figure it out. Any help would be appreciated! -Jake Merrick Entire rule: //Function to Make a QR code without truncating font size function MakeQRBarcodePreciseSize(DataToEncode, ProcessTilde, EncodingMode, ErrorCorrection, PreferredFormat, PointSize, NoFontTag, Font) { var encoded = EncodeQRBarcode(DataToEncode, ProcessTilde, EncodingMode, ErrorCorrection, PreferredFormat, PointSize, NoFontTag, Font); var ReplacedBR = ReplaceSubstring(encoded, "\r\n", "<br>"); var ReplacedSpaces = ReplaceSubstring(ReplacedBR, " ", ""); if (isNaN(PointSize)) return ReplacedSpaces; var WithPointSize = "<z newsize=\"" + Number(PointSize) + "\">" + ReplacedSpaces; if (NoFontTag) return WithPointSize; var WithFontTag = "<f name=\"" + Font + "\">" + WithPointSize; return WithFontTag; } // vCard 3.0 format // http://en.wikipedia.org/wiki/vCard var info = { N: ToTitleCase(Field("LastName")) + ';' + ToTitleCase(Field("FirstName")) + ';;;;', FN: ToTitleCase(Field("FirstName")) + ' ' + ToTitleCase(Field("LastName")), TITLE: ToTitleCase(Field("Title1")), "TEL;type=Phone": Field("Phone"), "TEL;type=Toll Free": Field("TollFree"), EMAIL: ToLower(Field("Email")), URL: "innovativeos.com", } var result = ["BEGIN:VCARD", "VERSION:3.0"]; for (var label in info) { if (info[label]) result.push(label + ":" + info[label]); } result.push("END:VCARD"); var EncodingMode = "Byte"; var ErrorCorrectionMode = "M"; var PreferredFormat = "0"; //ONLY USE 1 POINT AFTER DECIMAL OR LEADING WILL NOT WORK CORRECTLY var PointSize = "3.4"; var NoFontTag = false; var Font = "IDAutomation2D"; var ProcessTilde = false; // COPYFIT QR CODE // function CopyfitLineWithMagnifyTag(line, widthInPoints, AllowToExpand) { var tm = new FusionProTextMeasure; tm.CalculateTextExtent(line); if (tm.messages) ReportError("CopyfitMagnifyLine: " + tm.messages); if (tm.textWidth < widthInPoints*100 && !AllowToExpand) return line; var factor = Round(widthInPoints / tm.textWidth * 10000, 0) - 1; return "<magnify type=pointsize factor=" + factor + ">" + line + "</magnify>"; //this horizontally scales type, to proportional scale type change "type=setwidth" to "type=pointsize" } var textFrameWidth = FindTextFrame("QRBox").GetSettableTextWidth() / 100; //change "ContactBox" to the name of the text frame return CopyfitLineWithMagnifyTag( '<p br=false linespacing=".833333">' + MakeQRBarcodePreciseSize(result.join(Chr(13) + Chr(10)), ProcessTilde,EncodingMode, ErrorCorrectionMode, PreferredFormat,PointSize, NoFontTag, Font), textFrameWidth);
  2. I have a job that is using 2 data sources; a multi-line data source and a single line presorted address list. Since I can't use a secondary data source as multi-line, I'm using the presorted mailing list as the secondary data source. I got everything to work correctly, however FusionPro is getting the output order from the primary data source. Is there any way to get it to output using the order from the secondary data source? I'm using 11.2.1
  3. I have about 30 FusionPro documents (and growing) that all use the same list of addresses. I put a for loop in the OnRecordStart rule that cycles through the list and assigns the addresses to different variable to be used throughout the document. All of these FusionPro documents are hosted on a web to print system; so when there is a change to the address list I end up going through each of the files, update the loop, collect, and re-upload into my web to print system. Is it possible to reference an external text file and insert the contents into a rule? I'm thinking if I can put the for loop in a text file on my web server and somehow reference it via URL in my OnRecordStart rule, I would only need to update the text file on the web server, and the 30 documents would automatically be updated without having to do anything to them individually. Thanks, Jake Merrick
  4. Thanks Scott! That was exactly what I was trying to do.
  5. I'm trying to force formatting on an email address. What my customer wants is First.Last@CassiaLife.org I sort of got this to work, so if I enter first.last or first.last@whatever.com it will return the correct result: var str = Field("email"); var firstletter = Left(Field("email"),1); firstletter = ToUpper(firstletter); var letterposition = Field("email").indexOf(".")+1 var letter = Mid(Field("email"),letterposition+1,1); letter = ToUpper(letter); var front = str.substr(1,str.indexOf(".")); var length = Field("Email").length - letterposition; var back = Mid(Field("Email"),letterposition+2,length-1); var fixed = firstletter + front + letter + back; var str = fixed; var newstr = str.substr(0,str.indexOf("@")); if (Field("Email") != '') { if (newstr != "") return newstr + "@CassiaLife.org"; else return fixed + "@CassiaLife.org"; } else return '' However I'm running into two issues: 1. The code seems kind of clunky (I'm not a Javascript expert by any means) 2. It only works on the character after the first period. While I doubt that anyone would have more than one period, it would be nice if I could figure out a way to account for that possibility.
  6. Dan, Collected files attached. It is the field CellFax (the rule DispayCellFax displays it); when set to "Y" it displays the cell and and fax on the same line and the baseline looks right, if set to "N" it displays them on two lines and the baseline shifts. Thanks for looking at it, Jake Merrick Fusion Pro.zip
  7. There is plenty of space (at least 3 text lines), so I don't think that is the issue. Thanks, Jake
  8. I have a text box where that is aligned to the bottom (lower box with address in the attached image), it is supposed to be aligned to the blue guide (see attached file correct.jpg). I have a rule that changes whether the 2 phone numbers display on one line or two based on user input; when the phone numbers display on 2 lines the baseline shifts up (see attached file incorrect). I can't figure out why this is happening, has anyone seen this before? Thanks, Jake
  9. I have a job where I need to have a logo that is inline with some text. In the past I have simply put a rule to return the graphic inside the text box so that it flows with the text. However for this one the user is uploading their logo so I would need to resize it proportionally to be no larger that a certain size. Anyone know how this might be accomplished? Thanks, Jake Merrick
  10. I have some text that I have set to be small caps and underlined, however when I look at the output the underline is thicker underneath the first letter of each word, then gets thinner under the small cap remaining letters in the words. Is there any way to make the underline the same thickness on all letters that are being underlined? Thanks, Jake Merrick
  11. Dan, Thanks for all the help, I'll reach out to support about the custom template building.
  12. Dan, Sorry I wasn't clear. It sounds like what I am trying to do is not possible. It would be to take the CMYK values that the user inputs and use that as a fill color of a box at 50% transparency so the static image underneath shows through. Thanks, Jake Merrick
  13. Dan, Thanks. Unfortunately that won't work in this case. I'm having the user input CMYK values, so I won't know all the color options. There is no way to make a box transparent, right? Thanks, Jake Merrick
  14. Is it possible to have a box with a transparent background? I have a static background image that has a semi-transparent box with a solid color background covering part of the background image. I would like the user to be able to select the color of transparent box that is in front of the background image. Thanks.
  15. Dan, Thanks for the response. I got it to work, but I'm not really sure why. I took my original rule and duplicated it to try your suggestions. Before I actually changed it I put the rule in a text box along with the original, and one of them worked while the other one didn't (even though they were exactly the same rule, producing exactly the same output). I then deleted the rule that wasn't working, and that caused the other rule to stop working as well. I then duplicated the rule that wasn't working, which caused one of them to start working. I'm not sure what is going on. So I checked the box "Re-evaluate this rule for every text flow" and that fixed it. I'm not sure why that would have fixed it, but it did. Thanks, Jake Merrick
  16. I'm having trouble copyfitting a certain font. I'm using this code: var StaticPart = ""; //This text will not copyfit. var DynamicPart = '<tracking newsize="4.5"><b>' + Rule("DetermineFrontEmail") + '</b>'; //This text will copyfit. var TextFont = "Akzidenz-Grotesk BQ Condensed A"; var FontSize = 8; var TextFrameName = "ContactBoxFront"; //For width calculation var MinFontSize = 4; var AdjustWidthOnly = false; if (Field("Email") == "" || Left(Field("Email"), 1) == "@") return ""; else return CopyfitLine(StaticPart,DynamicPart,TextFont,FontSize, FindTextFrame(TextFrameName).GetSettableTextWidth()/100, MinFontSize, AdjustWidthOnly); Which generates a font size smaller than 8, but not small enough to fit on one line: <f name="Akzidenz-Grotesk BQ Condensed A"><z newsize=8><z newsize=7.0000000000000036><tracking newsize="4.5"><b>jmerricklongname@access-genetics.com</b> The funny thing is, if I change the font it works fine; it seems to be just with this one font. The font is a bold font; I tried it without the <b> tags and got an error that normal style was not loaded, using bold style instead.
  17. Dan, That's awesome, thanks for the help! I was able to use that precision to get the code exactly the size I needed.
  18. David, Thanks for the help. I was able to get the correct data into the vCard from your response. However, it seems like the PointSize variable rounds down to a whole number, so even when I put 3.625, it outputs the font size as 3. I was able to get around this by adjusting the PreferredFormat number. By putting that at 17 instead of 0 it got the size pretty close. It seems that the PreferredFormat variable also rounds down. It would be nice to be able to more precisely control the size, but this solutions got it to within 1/16" of the size it is supposed to be, which will work in this case.
  19. Tou, Thanks for the reply. I can get the text QR code to work in the color I need, however what I'm not sure how to do is create a VCARD (instead of a MECARD), and how to get the font size to not be a whole number (I need the font size something like 3.625).
  20. I looked at that, however I have 2 problems with that rule: 1. It looks like a MECARD format, where the graphic rule is a VCARD. I need the extra fields that VCARD offers, I'm not sure how to use the text rule to create a VCARD instead of a MECARD. 2. it appears that I can only adjust the sizing of the QR code by changing the "PointSize" attribute, however it looks like it has to be a whole number, I need the QR code to fit in a space, so I would need a point size of something like 3.625. Thanks, Jake
  21. I'm trying to make a QR code that is a spot color. I've got the QR code created (as a graphic), however i can't seem to figure out how to change the color. I did try to create a text QR code, however it looks like it is in a different format and doesn't give me the all the contact fields I need.
  22. Dan, Those are composed screenshots. It doesn't matter what zoom level I look at it, it displays like the screenshot. However I didn't even think to try and print it, that worked! It printed correctly and scanned. Really weird, I've never had something that prints that differently than it looks on screen. Thanks for the help.
  23. Dan, I've tried that. When scaling is set to none, I get the attached file No Scaling.jpg. When I have scaling set to Best Fit (with clipping both on and off, it doesn't seem to make a difference), I get the attached file With Scaling.jpg. The squares in the corner are off and it won't scan.
  24. I have a graphic rule that creates a QR code (built in to FusionPro). It works great, however I would like to be able resize the code. I thought I could just change the Scaling on the Graphic frame to Proportional Fill or Fill to Shortest Edge. When I try any of the Scale options other than None (I've tried with clipping both on and off), the QR code always gets clipped off slightly, just enough to make in unreadable. Has anyone come across this issue?
×
×
  • Create New...