Skip to main content
JValen9362
Participant
August 30, 2020
Answered

Simple DataMatrix code

  • August 30, 2020
  • 1 reply
  • 4856 views

Hi,

 

is posible to use this script from this post with Indesign?

https://community.adobe.com/t5/illustrator/simple-datamatrix-code/td-p/10396528?page=1

I want to llenerate 2D Datamatrix Barcode from Mail Merge Data.

I know Indesign has a nice QR Code tool but I need to generate Datamatrix.

I also know there are some 3rd party plugins,  most dont genertate the barcode in the fly with export to PDF.

most plugins first need to create Indesign Documnet for each record then print to PDF. witch is redicules long and painful process.

 

Thanks.

This topic has been closed for replies.
Correct answer Laubender

Should be possible, I think.

/*

... the datamatrix.js code pasted in above ...

*/

var doc = app.documents.add();
var str = "ABCDEFG!";

var dm = new Datamatrix();
var ascii = dm.getDigit(str, false);

var newTextFrame = doc.textFrames.add
(
{
geometricBounds : doc.pages[0].bounds,
contents : ascii
}
);

 

Note: Read the comments in that thread about the code that must be positioned at top of the one given here.

Also what you need to strip off. The screenshots showing the ESTK should be helpful.

 

FWIW: I did not test that at all, just ported the bit that Adobe Illustrator has to do to specific ExtendScript code for InDesign. It will create a new document with a new text frame and puts the retrieved data as contents in that frame.

 

Regards,
Uwe Laubender

( ACP )

1 reply

LaubenderCommunity ExpertCorrect answer
Community Expert
August 31, 2020

Should be possible, I think.

/*

... the datamatrix.js code pasted in above ...

*/

var doc = app.documents.add();
var str = "ABCDEFG!";

var dm = new Datamatrix();
var ascii = dm.getDigit(str, false);

var newTextFrame = doc.textFrames.add
(
{
geometricBounds : doc.pages[0].bounds,
contents : ascii
}
);

 

Note: Read the comments in that thread about the code that must be positioned at top of the one given here.

Also what you need to strip off. The screenshots showing the ESTK should be helpful.

 

FWIW: I did not test that at all, just ported the bit that Adobe Illustrator has to do to specific ExtendScript code for InDesign. It will create a new document with a new text frame and puts the retrieved data as contents in that frame.

 

Regards,
Uwe Laubender

( ACP )

JValen9362
Participant
September 6, 2020

Thank You Uwe.for you reply, I will try..