• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Automatic create multiple QR-codes in Indesign adding a new page for every code

New Here ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

I 've been asked to create a document with 10.000 pages. On every page I need to place a unique QR-code that refers to a unique url. I want to generate the QR-codes automaticly (based on a CSV-list or something else?) and would like automaticly add a page for every QR-code (with the data-merge-function in indesign?)

 

TOPICS
How to

Views

283

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

You need to create a placeholder - Rectangle on a page - InDesign will do the rest. 

 

Or are you asking for a step-by-step guidance? 

 

https://helpx.adobe.com/uk/indesign/using/data-merge.html

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2024 Feb 09, 2024

Copy link to clipboard

Copied

LATEST

Hi @total copys73685545 , You could script the creation of the document and pages, which might be easier than a data merge. This opens a text file on the desktop with each url as a line, and creates the pages and qCodes. You might have a problem creating a 10,000 page doc with a eps on each page—probably depends on your hardware. Something like this might work:

 

/* a text file on the desktop  named URLList.txt with the urls with returns, e.g.
www.adobe.com
www.instagram.com
www.goggle.com */

var qc = readFile(File(Folder.desktop + "/URLList.txt"))

app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;
var dn = "QCodes";

//tha page’s width and height
var pw = 6;
var ph = 6;

//make a new document
var currdate = new Date
var dp = makeDocPreset("Temp-" + currdate.getTime());
dp.properties = {facingPages:false, pageHeight:pw, pageWidth:ph, top:0, bottom:0, left:0, right:0}
var doc = app.documents.add(true, dp);
doc.name = "QCodes"
dp.remove();

//loop through the url list and add pages with the codes
var np, r;
for (var i = 0; i < qc.length; i++){
    np = doc.pages.add()
    r = np.rectangles.add({geometricBounds:[0, 0, ph, pw]})
    r.createHyperlinkQRCode(qc[i])
};   

app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE; 



/**
* Makes a new document preset 
* @ param preset name name 
* @ return the new preset 
*/
function makeDocPreset(n){
    if (app.documentPresets.itemByName(n).isValid) {
        return app.documentPresets.itemByName(n);
    } else {
        return app.documentPresets.add({name:n});
    }
}

/**
* Open a text file
* @ param The text file path 
* @ return the text’s paragraphs as an array 
* 
*/

function readFile(p) {
	var f = new File(p);
	f.open("r");  
	var x = f.read(); 
    var r = x.split("\n") 
	f.close();
	return r; 
}

Result

Screen Shot 21.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines