View Single Post
Old October 20th, 2014, 07:06 AM
jimmyhartington jimmyhartington is offline
Regular Contributor
Join Date: Nov 2012
Posts: 63
Default Change color and size of text QR-code


I have a template, where I need to make a QR-code and set the color of it.
So I have made a rule for this.
But what ever color or size I set in the text frame with the QR-code does not apply.

If I make QR-code from the built in dialogs (without converting to JavaScript), then I can change the color and size.

Here is my code
var PointSize = "18";
var NameRuleOrField = Trim(Field("Name"));
var CompanyRuleOrField = Rule("R Companyname for QR");
var PhoneRuleOrField = Trim(Field("Direct phone"));
var MobileRuleOrField = Trim(Field("Mobile phone"));
var EmailRuleOrField = Rule("R Email for QR");
var WebsiteRuleOrField = "";

if (Trim(Field("Title 2")).length == 0 )
  var TitleRuleOrField = Rule("R Title 1");
  var TitleRuleOrField = Rule("R Title 1") + ", " + Rule("R Title 2");

// vCard format


// Note that support for vCard may be more limited than for MECARD,

// and that vCard requires more data to be encoded, resulting in a denser barcode.

var info = {

    N: NameRuleOrField,

    ORG: CompanyRuleOrField,
    TITLE: TitleRuleOrField,

    "TEL;WORK;VOICE": PhoneRuleOrField,

    "TEL;WORK;CELL": MobileRuleOrField,

    EMAIL: EmailRuleOrField,

    URL: WebsiteRuleOrField,


var result = ["BEGIN:VCARD", "VERSION:2.1"];

for (var label in info)


    if (info[label])

        result.push(label + ":" + info[label]);



return MakeQRBarcodeGraphic(result.join(Chr(13) + Chr(10)));

var QR = new QRBarcode;

QR.pointSize = Int(PointSize) || 10;

return QR.Make(result);
And here is a collect of my job.

Hope somebody can see what is missing.
Kind regards Jimmy Hartington

Happy MarcomCentral® customer - OS version: macOS 10.15.5 - Acrobat DC - FusionPro version: 11.1.0
Reply With Quote