Simple DATAMATRIX code
I got this "simple" code for generating DATAMATRIX (ascii) (link).
It works great in Extend Script but doesn't work in Illustrator.
Please help.
I got this "simple" code for generating DATAMATRIX (ascii) (link).
It works great in Extend Script but doesn't work in Illustrator.
Please help.
Now is your great opportunity to port Node.js code into ancient EcmaScript 3!
What you have to do it go to https://github.com/tualo/tualo-datamatrix/blob/master/lib/datamatrix.js . and make it work inside of your Illustrator.
At brief look-over it does not appear that this code uses many modern features for ES3, so this will likely be an easy task!
The only modern feature I could see is the "exports" statement at the very bottom. I think you can just get rid of that.
Actually I couldn't help myself and did a test.
If you put in the code above with my exact instructions, it works!
/*
... the datamatrix.js code pasted in above ...
*/
var doc = app.activeDocument;
var str = "ABCDEFG!";
var dm = new Datamatrix();
var ascii = dm.getDigit(str, false);
var newText = doc.textFrames.add();
newText.size = [500, 500];
newText.contents = ascii;

Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.