Difference between revisions of "Barcode"

From Sega Retro

 
Line 1: Line 1:
<includeonly>
+
<includeonly><div style="display:none;">
{{{1|}}}
+
{{#vardefine:linewidth|{{{size|2}}}}}
{{#len:{{{1|}}}}}    {{#sub:{{{1|}}}|12|1}}
+
{{#vardefine:height|{{{height|{{#expr:{{#var:linewidth}}*65}}}}}}}
 
+
{{#vardefine:white|style="width:0px; max-height:{{#var:height}}px; height:{{#var:height}}px; padding:0px; border-left: {{#var:linewidth}}px solid #FFFFFF;"}}
<div style="display:none;">
+
{{#vardefine:black|style="width:0px; max-height:{{#var:height}}px; height:{{#var:height}}px; padding:0px; border-left: {{#var:linewidth}}px solid #000000;"}}
{{#vardefine:linewidth|3}}
 
{{#vardefine:height|{{#expr:{{#var:linewidth}}*65}}}}
 
{{#vardefine:white|style="width:0px; height:{{#var:height}}px; padding:0px; border-left: {{#var:linewidth}}px solid #FFFFFF;"}}
 
{{#vardefine:black|style="width:0px; height:{{#var:height}}px; padding:0px; border-left: {{#var:linewidth}}px solid #000000;"}}
 
  
 
{{#switch:{{#len:{{{1|}}}}}
 
{{#switch:{{#len:{{{1|}}}}}
Line 117: Line 113:
 
{{#vardefine:LRColumns|42}}
 
{{#vardefine:LRColumns|42}}
 
}}
 
}}
 
 
 
</div>
 
</div>
 
{|style="width:auto; font-family: monospace;"
 
{|style="width:auto; font-family: monospace;"
Line 202: Line 196:
 
|colspan="5" style="text-align:center; height:{{#expr:{{#var:linewidth}}*4.5}}px; width:0px; padding:0px;"|
 
|colspan="5" style="text-align:center; height:{{#expr:{{#var:linewidth}}*4.5}}px; width:0px; padding:0px;"|
 
|colspan="3" style="text-align:center; height:{{#expr:{{#var:linewidth}}*4.5}}px; width:0px; padding:0px;"|
 
|colspan="3" style="text-align:center; height:{{#expr:{{#var:linewidth}}*4.5}}px; width:0px; padding:0px;"|
|}</includeonly><noinclude>
+
|}{{clearvar|white|black|height|linewidth|textStyle}}</includeonly><noinclude>
 +
 
 +
Template for generating barcodes. It does UPC-A, it does EAN-13, it was simultaneously less faffy and more faffy than I expected.
 +
 
 +
==Usage==
 +
<pre>{{Barcode|4974365541149}}</pre>
 +
 
 +
{{Barcode|4974365541149}}
  
 +
Use <tt>size</tt> and <tt>height</tt> arguments to change dimensions and ting.
  
 +
==Examples==
 
[[File:EC MD JP Box.jpg|800px]]
 
[[File:EC MD JP Box.jpg|800px]]
  
Line 212: Line 215:
  
 
{{Barcode|010086011456}}
 
{{Barcode|010086011456}}
 +
 +
{{Barcode|010086011456|size=1}}
 +
{{Barcode|010086011456|size=1.5}}
 +
{{Barcode|010086011456|size=2}}
 +
{{Barcode|010086011456|size=3}}
 +
 +
 +
{{Barcode|010086011456|height=50}}
  
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Latest revision as of 12:50, 27 June 2023


Template for generating barcodes. It does UPC-A, it does EAN-13, it was simultaneously less faffy and more faffy than I expected.

Usage

{{Barcode|4974365541149}}




}}



4 9 7 4 3 6 5 5 4 1 1 4 9

Use size and height arguments to change dimensions and ting.

Examples

EC MD JP Box.jpg




}}



4 9 7 4 3 6 5 5 4 1 1 4 9

EC MD US Box.jpg




}}

0 1 0 0 8 6 0 1 1 4 5 6




}}

0 1 0 0 8 6 0 1 1 4 5 6




}}

0 1 0 0 8 6 0 1 1 4 5 6




}}

0 1 0 0 8 6 0 1 1 4 5 6




}}

0 1 0 0 8 6 0 1 1 4 5 6





}}

0 1 0 0 8 6 0 1 1 4 5 6