Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h2>Batch QR Code generator</h2>

  <label for="codeSize" class="smallText">Code size (pixels)</label>
  <input id="codeSize" type="number" min="40" value="45" </input>

  <label for="codeMargin" class="smallText">Code margin (pixels)</label>
  <input id="codeMargin" type="number" min="0" value="0" </input>

  <label for="prefixTxt" class="smallText">Code prefix</label>
  <input id="prefixTxt" type="text" placeholder="will be prepended to every code" </input>
  <label for="inTxt" class="smallText"><b>Code values</b> (one line = one code)</label>
  <textarea id="inTxt" class="mono" type="text" placeholder="Paste Tag codes here. One line=one code, blank lines will be ignored." rows="10" cols="50"></textarea>

<button onclick="generateQRcodes()">Generate & Download QR codes</button>


  font-family: 'Noto Sans', sans-serif;

  background-color: #ccc;
  padding: 10px;

body, div, span, button{

  margin: 6px;

  font-family: 'Consolas', monospace;
  font-size: 0.8em;

  color: red;
  font-size: 0.75em;

  background-color: none;

  background-color: white;


                var width = 45, height = 45;
var prefix = ""
var codeMargin = 0;

function getParameters(){
prefix = document.getElementById("prefixTxt").value;
width = height = document.getElementById("codeSize").value;
codeMargin = document.getElementById("codeMargin").value;

function generateQRcodes(){


  var allText = document.getElementById("inTxt").value;
  var codes = allText.match(/[^\n\r]+/g); 
  if (codes.length == 0) return;
  const pdf = new jsPDF({
      unit: 'pt',
      orientation: 'p',
      format: [width, height],
      lineHeight: 1.2

var svgEl = document.createElement('svg');

for (var i=0; i<codes.length; i++){

qrcode = new QRCode({
  content: document.getElementById("prefixTxt").value + codes[i],
  padding: codeMargin,
  width: width,
  height: height,
  color: "black",
  background: "none",
  ecl: "L"


svgEl.innerHTML = qrcode.svg();

// render the svg element
svg2pdf(svgEl, pdf, {
	xOffset: 0,
	yOffset: 0,
	scale: 1

// save pdf'qrcodes');
// savePDFs(pdfArr, codes);
// get the data URI
//const uri = pdf.output('datauristring');


document.getElementById("prefixTxt").value = prefix;
document.getElementById("codeSize").value = width;
document.getElementById("codeMargin").value = codeMargin;