APP Posted March 10, 2011 Share Posted March 10, 2011 Trying to create a QR code. Using the rule QR Contact Information within fusion pro. This seems to be a mecard rule I am guessing. I Like to create a Vcard. Basically, this card rule may work except we want to include company within the tag, The code I use/altering is not creating the field company and does not show up on the phone as a contact. Company name does not display. All other information does. What am I doing wrong? Basically, I need Contact Name, Company Name, Phone, Email. Rule as follows... var NameFieldOrRule = "QR Contact Name"; var OrgFieldOrRule = "Organization"; var PhoneFieldOrRule = "QR Phone"; var EmailFieldOrRule = "QR Email"; var WebsiteFieldOrRule = ""; var AddressFieldOrRule = ""; var BirthdayFieldOrRule = ""; var PointSize = ""; // MECARD format // http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/addressbook // Also see: http://code.google.com/p/zxing/wiki/BarcodeContents var info = { N: FieldOrRule(NameFieldOrRule), ORG: FieldOrRule(OrgFieldOrRule), TEL: OptionalFieldOrRule(PhoneFieldOrRule).replace(/\D/g,''), EMAIL: OptionalFieldOrRule(EmailFieldOrRule), URL: OptionalFieldOrRule(WebsiteFieldOrRule), ADR: OptionalFieldOrRule(AddressFieldOrRule), BDAY: OptionalFieldOrRule(BirthdayFieldOrRule), } var result = ""; for (var label in info) { if (!info[label]) continue; result += label; if (!label.match(/\:$/)) result += ":"; result += info[label]; result += FusionPro.inValidation ? '\r' : ';'; } if (FusionPro.inValidation) return result; var QR = new QRBarcode; QR.pointSize = Int(PointSize) || 10; return QR.Make("MECARD:" + result + ";"); Link to comment Share on other sites More sharing options...
Dan Korn Posted March 10, 2011 Share Posted March 10, 2011 Well, the "ORG" field is something you added yourself. It's not part of the default QR Contact Information rule in FusionPro, nor, as far as I know, is it part of the MECARD standard. The valid MECARD fields are very clearly listed at the site pointed to by the nttdocomo.co.jp URL in the rule. Anything other fields you add on your own might be supported by certain devices, but I wouldn't count on it. Link to comment Share on other sites More sharing options...
Dan Korn Posted March 10, 2011 Share Posted March 10, 2011 You can create a QR barcode with vCard information using logic like this: var info = { // ADD OR REMOVE FIELDS HERE TO MATCH YOUR DATA N: FieldOrRule("QR Contact Name"), "TEL;WORK;VOICE": FieldOrRule("QR Phone").replace(/\D/g,''), "TEL;WORK;FAX": FieldOrRule("QR Fax").replace(/\D/g,''), EMAIL: FieldOrRule("QR Email"), URL: FieldOrRule("www"), ORG: FieldOrRule("Organization"), TITLE: FieldOrRule("title1"), } var result = ""; for (var label in info) { if (!info[label]) continue; result += label; if (!label.match(/\:$/)) result += ":"; result += info[label]; result += FusionPro.inValidation ? "\n" : "\r\n"; } if (FusionPro.inValidation) return result; var QR = new QRBarcode; QR.errorCorrectionLevel = "L"; QR.pointSize = 8; //QR.preferredFormat = 1; result = "BEGIN:VCARD\r\n" + result + "VERSION:2.1\r\nEND:VCARD"; return QR.Make(result); //return "VCARD: " + result.length + " chars<br>" + QR.Make(result);The vCard format offers a multitude of fields, much more than the simple MECARD format allows. However, this extra flexibility comes at a price. Specifically, there are two major caveats. One is that the vCard format is much more verbose than MECARD, so it requires more data to be encoded in the barcode, which will make the barcode larger. You can compensate by making the point size smaller, as my example does, but that will make the barcode harder to scan. The other caveat is the the vCard format may not be supported by as many devices as MECARD. And some devices and apps may support different fields in different ways. This technology is still in its early stages, and it's a bit like the early Wild West days of the Internet where things worked differently on 17 different web browsers. So test with as many devices and apps as possible. Link to comment Share on other sites More sharing options...
APP Posted March 10, 2011 Author Share Posted March 10, 2011 Thanks. That is what I thought after much resarch. I assume that I can take the vcard script code and run it thru fusion pro and back into Marcom central for use within a template. So a user can fill out some of the vcard info via a store front template, not too much...., and have the system create the proper QR code, with the 4 or 5 fields we need. Thoughts on this....Thanks. Link to comment Share on other sites More sharing options...
Dan Korn Posted March 11, 2011 Share Posted March 11, 2011 Thanks. That is what I thought after much resarch. I assume that I can take the vcard script code and run it thru fusion pro and back into Marcom central for use within a template. So a user can fill out some of the vcard info via a store front template, not too much...., and have the system create the proper QR code, with the 4 or 5 fields we need. Thoughts on this....Thanks. Sure, it will work fine on MarcomCentral. You can probably get it to work with 4 or 5 fields, but there's definitely a tradeoff with the amount of data that needs to be encoded, and the resulting barcode size. We (Printable/PTI) ran into this same dilemma making our own internal business cards. Eventually we settled on the MECARD format, even though it offers fewer fields, because the vCard information made the barcode too large. These are limitations of the QR barcode and vCard encoding standards, and we can't do much to get around them in FusionPro. Link to comment Share on other sites More sharing options...
IndexxPrep Posted April 21, 2011 Share Posted April 21, 2011 I am working with a VCard QR Code and cannot seem to get the Phone Labels to work, nor does the Company info appear by using "ORG" either. I have tried many different code readers on an iphone and they all produce the same result. All phone come across with "Main" instead of "Work" & "Mobile" and the Company info doesn't appear at all. Any ideas? My client is hoping for a proof this morning and I have already spent 2 hours trying to get this to work. Thanks! -IndexxPrep Link to comment Share on other sites More sharing options...
Dan Korn Posted April 21, 2011 Share Posted April 21, 2011 I am working with a VCard QR Code and cannot seem to get the Phone Labels to work, nor does the Company info appear by using "ORG" either. I have tried many different code readers on an iphone and they all produce the same result. All phone come across with "Main" instead of "Work" & "Mobile" and the Company info doesn't appear at all. Any ideas? My client is hoping for a proof this morning and I have already spent 2 hours trying to get this to work. You could post your rule here, and/or some examples of the barcodes you're generating, either of which might help someone else be able to help you. Or, as I've said before, if you have an example of a barcode which does result in the desired information coming up in your scanning app, you can post that and we can try to reverse engineer it and create a rule to make a similar barcode. Link to comment Share on other sites More sharing options...
IndexxPrep Posted April 22, 2011 Share Posted April 22, 2011 Dan, The code I am using is the vcard code that you had posted with no alterations other than the additional phone number. As far as I can tell with all of the testing I have done, output can vary drastically depending on the QR reader you are using. Because of the client requesting two phone numbers in the QR data, I had to use VCard format instead of Mecard. I have only I app that reads all of the vcard data properly the rest only grab a few of the fields. The app I have that works perfect is called QR to VCard, obviously it is specific to vcard format. The problem now is the end user scanning the card with a sub-par QR app or an app that doesn't recognize Vcard data. Oh well, we can't control everything. Consider this issue resolved. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.