rghost_barcode 0.8 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/lib/rghost_barcode.rb +7 -5
  2. data/lib/rghost_barcode/ps/barcode_base.ps +17090 -0
  3. data/lib/rghost_barcode/rghost_barcode_adapter.rb +22 -226
  4. data/lib/rghost_barcode/rghost_barcode_base.rb +12 -14
  5. data/lib/rghost_barcode/rghost_barcode_types.rb +86 -0
  6. data/lib/rghost_barcode/rghost_barcode_version.rb +2 -2
  7. metadata +30 -177
  8. data/lib/doc/classes/RGhost.html +0 -109
  9. data/lib/doc/classes/RGhost/Barcode.html +0 -147
  10. data/lib/doc/classes/RGhost/Barcode/Auspost.html +0 -113
  11. data/lib/doc/classes/RGhost/Barcode/Azteccode.html +0 -113
  12. data/lib/doc/classes/RGhost/Barcode/Base.html +0 -266
  13. data/lib/doc/classes/RGhost/Barcode/Base.src/M000004.html +0 -34
  14. data/lib/doc/classes/RGhost/Barcode/Base.src/M000005.html +0 -30
  15. data/lib/doc/classes/RGhost/Barcode/Base.src/M000006.html +0 -20
  16. data/lib/doc/classes/RGhost/Barcode/Border.html +0 -170
  17. data/lib/doc/classes/RGhost/Barcode/Border.src/M000001.html +0 -27
  18. data/lib/doc/classes/RGhost/Barcode/Code11.html +0 -113
  19. data/lib/doc/classes/RGhost/Barcode/Code128.html +0 -113
  20. data/lib/doc/classes/RGhost/Barcode/Code2of5.html +0 -113
  21. data/lib/doc/classes/RGhost/Barcode/Code39.html +0 -113
  22. data/lib/doc/classes/RGhost/Barcode/Code93.html +0 -113
  23. data/lib/doc/classes/RGhost/Barcode/Datamatrix.html +0 -113
  24. data/lib/doc/classes/RGhost/Barcode/Ean13.html +0 -113
  25. data/lib/doc/classes/RGhost/Barcode/Ean2.html +0 -113
  26. data/lib/doc/classes/RGhost/Barcode/Ean5.html +0 -113
  27. data/lib/doc/classes/RGhost/Barcode/Ean8.html +0 -113
  28. data/lib/doc/classes/RGhost/Barcode/Guard.html +0 -174
  29. data/lib/doc/classes/RGhost/Barcode/Guard.src/M000003.html +0 -27
  30. data/lib/doc/classes/RGhost/Barcode/Interleaved2of5.html +0 -113
  31. data/lib/doc/classes/RGhost/Barcode/Isbn.html +0 -113
  32. data/lib/doc/classes/RGhost/Barcode/Kix.html +0 -113
  33. data/lib/doc/classes/RGhost/Barcode/Maxicode.html +0 -113
  34. data/lib/doc/classes/RGhost/Barcode/Msi.html +0 -113
  35. data/lib/doc/classes/RGhost/Barcode/Onecode.html +0 -113
  36. data/lib/doc/classes/RGhost/Barcode/Parameter.html +0 -262
  37. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000007.html +0 -20
  38. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000008.html +0 -18
  39. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000009.html +0 -18
  40. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000010.html +0 -18
  41. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000011.html +0 -18
  42. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000012.html +0 -24
  43. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000013.html +0 -18
  44. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000014.html +0 -18
  45. data/lib/doc/classes/RGhost/Barcode/Parameter.src/M000015.html +0 -16
  46. data/lib/doc/classes/RGhost/Barcode/Pdf417.html +0 -113
  47. data/lib/doc/classes/RGhost/Barcode/Pharmacode.html +0 -113
  48. data/lib/doc/classes/RGhost/Barcode/Plessey.html +0 -113
  49. data/lib/doc/classes/RGhost/Barcode/Postnet.html +0 -113
  50. data/lib/doc/classes/RGhost/Barcode/Qrcode.html +0 -113
  51. data/lib/doc/classes/RGhost/Barcode/Rationalizedcodabar.html +0 -113
  52. data/lib/doc/classes/RGhost/Barcode/Raw.html +0 -113
  53. data/lib/doc/classes/RGhost/Barcode/Royalmail.html +0 -113
  54. data/lib/doc/classes/RGhost/Barcode/Rss14.html +0 -113
  55. data/lib/doc/classes/RGhost/Barcode/Rssexpanded.html +0 -113
  56. data/lib/doc/classes/RGhost/Barcode/Rsslimited.html +0 -113
  57. data/lib/doc/classes/RGhost/Barcode/Symbol.html +0 -113
  58. data/lib/doc/classes/RGhost/Barcode/Text.html +0 -193
  59. data/lib/doc/classes/RGhost/Barcode/Text.src/M000002.html +0 -30
  60. data/lib/doc/classes/RGhost/Barcode/Upca.html +0 -113
  61. data/lib/doc/classes/RGhost/Barcode/Upce.html +0 -113
  62. data/lib/doc/classes/RGhost/Config.html +0 -150
  63. data/lib/doc/classes/RGhost/Config.src/M000016.html +0 -45
  64. data/lib/doc/classes/RGhost/Document.html +0 -704
  65. data/lib/doc/classes/RGhost/Document.src/M000017.html +0 -19
  66. data/lib/doc/classes/RGhost/Document.src/M000018.html +0 -18
  67. data/lib/doc/classes/RGhost/Document.src/M000019.html +0 -18
  68. data/lib/doc/classes/RGhost/Document.src/M000020.html +0 -18
  69. data/lib/doc/classes/RGhost/Document.src/M000021.html +0 -18
  70. data/lib/doc/classes/RGhost/Document.src/M000022.html +0 -18
  71. data/lib/doc/classes/RGhost/Document.src/M000023.html +0 -18
  72. data/lib/doc/classes/RGhost/Document.src/M000024.html +0 -18
  73. data/lib/doc/classes/RGhost/Document.src/M000025.html +0 -18
  74. data/lib/doc/classes/RGhost/Document.src/M000026.html +0 -18
  75. data/lib/doc/classes/RGhost/Document.src/M000027.html +0 -18
  76. data/lib/doc/classes/RGhost/Document.src/M000028.html +0 -18
  77. data/lib/doc/classes/RGhost/Document.src/M000029.html +0 -18
  78. data/lib/doc/classes/RGhost/Document.src/M000030.html +0 -18
  79. data/lib/doc/classes/RGhost/Document.src/M000031.html +0 -18
  80. data/lib/doc/classes/RGhost/Document.src/M000032.html +0 -18
  81. data/lib/doc/classes/RGhost/Document.src/M000033.html +0 -18
  82. data/lib/doc/classes/RGhost/Document.src/M000034.html +0 -18
  83. data/lib/doc/classes/RGhost/Document.src/M000035.html +0 -18
  84. data/lib/doc/classes/RGhost/Document.src/M000036.html +0 -18
  85. data/lib/doc/classes/RGhost/Document.src/M000037.html +0 -18
  86. data/lib/doc/classes/RGhost/Document.src/M000038.html +0 -18
  87. data/lib/doc/classes/RGhost/Document.src/M000039.html +0 -18
  88. data/lib/doc/classes/RGhost/Document.src/M000040.html +0 -18
  89. data/lib/doc/classes/RGhost/Document.src/M000041.html +0 -18
  90. data/lib/doc/classes/RGhost/Document.src/M000042.html +0 -18
  91. data/lib/doc/classes/RGhost/Document.src/M000043.html +0 -18
  92. data/lib/doc/classes/RGhost/Document.src/M000044.html +0 -18
  93. data/lib/doc/classes/RGhost/Document.src/M000045.html +0 -18
  94. data/lib/doc/classes/RGhost/Document.src/M000046.html +0 -18
  95. data/lib/doc/classes/RGhost/Document.src/M000047.html +0 -18
  96. data/lib/doc/classes/RGhost/Document.src/M000048.html +0 -18
  97. data/lib/doc/created.rid +0 -1
  98. data/lib/doc/files/rghost_barcode/rghost_barcode_adapter_rb.html +0 -101
  99. data/lib/doc/files/rghost_barcode/rghost_barcode_base_rb.html +0 -101
  100. data/lib/doc/files/rghost_barcode/rghost_barcode_classes_rb.html +0 -101
  101. data/lib/doc/files/rghost_barcode/rghost_barcode_examples_rb.html +0 -101
  102. data/lib/doc/files/rghost_barcode/rghost_barcode_version_rb.html +0 -101
  103. data/lib/doc/files/rghost_barcode_rb.html +0 -111
  104. data/lib/doc/files/teste_main_rb.html +0 -110
  105. data/lib/doc/fr_class_index.html +0 -67
  106. data/lib/doc/fr_file_index.html +0 -33
  107. data/lib/doc/fr_method_index.html +0 -74
  108. data/lib/doc/index.html +0 -24
  109. data/lib/rghost_barcode/ps/auspost.ps +0 -192
  110. data/lib/rghost_barcode/ps/azteccode.ps +0 -357
  111. data/lib/rghost_barcode/ps/barcode_template.eps +0 -1193
  112. data/lib/rghost_barcode/ps/code11.ps +0 -128
  113. data/lib/rghost_barcode/ps/code128.ps +0 -121
  114. data/lib/rghost_barcode/ps/code2of5.ps +0 -106
  115. data/lib/rghost_barcode/ps/code39.ps +0 -109
  116. data/lib/rghost_barcode/ps/code93.ps +0 -117
  117. data/lib/rghost_barcode/ps/datamatrix.ps +0 -328
  118. data/lib/rghost_barcode/ps/ean13.ps +0 -183
  119. data/lib/rghost_barcode/ps/ean2.ps +0 -101
  120. data/lib/rghost_barcode/ps/ean5.ps +0 -116
  121. data/lib/rghost_barcode/ps/ean8.ps +0 -101
  122. data/lib/rghost_barcode/ps/interleaved2of5.ps +0 -132
  123. data/lib/rghost_barcode/ps/isbn.ps +0 -118
  124. data/lib/rghost_barcode/ps/kix.ps +0 -98
  125. data/lib/rghost_barcode/ps/maxicode.ps +0 -307
  126. data/lib/rghost_barcode/ps/msi.ps +0 -104
  127. data/lib/rghost_barcode/ps/onecode.ps +0 -276
  128. data/lib/rghost_barcode/ps/pdf417.ps +0 -428
  129. data/lib/rghost_barcode/ps/pharmacode.ps +0 -69
  130. data/lib/rghost_barcode/ps/plessey.ps +0 -121
  131. data/lib/rghost_barcode/ps/postnet.ps +0 -114
  132. data/lib/rghost_barcode/ps/qrcode.ps +0 -530
  133. data/lib/rghost_barcode/ps/rationalizedcodabar.ps +0 -117
  134. data/lib/rghost_barcode/ps/raw.ps +0 -35
  135. data/lib/rghost_barcode/ps/render.ps +0 -307
  136. data/lib/rghost_barcode/ps/render.ps~ +0 -308
  137. data/lib/rghost_barcode/ps/royalmail.ps +0 -119
  138. data/lib/rghost_barcode/ps/rss14.ps +0 -237
  139. data/lib/rghost_barcode/ps/rssexpanded.ps +0 -211
  140. data/lib/rghost_barcode/ps/rsslimited.ps +0 -191
  141. data/lib/rghost_barcode/ps/symbol.ps +0 -49
  142. data/lib/rghost_barcode/ps/upca.ps +0 -128
  143. data/lib/rghost_barcode/ps/upce.ps +0 -157
  144. data/lib/rghost_barcode/rghost_barcode_classes.rb +0 -96
  145. data/lib/rghost_barcode/rghost_barcode_examples.rb +0 -35
  146. data/lib/teste_main.rb +0 -94
@@ -1,33 +0,0 @@
1
-
2
- <?xml version="1.0" encoding="iso-8859-1"?>
3
- <!DOCTYPE html
4
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
-
7
- <!--
8
-
9
- Files
10
-
11
- -->
12
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
- <head>
14
- <title>Files</title>
15
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
- <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
- <base target="docwin" />
18
- </head>
19
- <body>
20
- <div id="index">
21
- <h1 class="section-bar">Files</h1>
22
- <div id="index-entries">
23
- <a href="files/rghost_barcode_rb.html">rghost_barcode.rb</a><br />
24
- <a href="files/rghost_barcode/rghost_barcode_adapter_rb.html">rghost_barcode/rghost_barcode_adapter.rb</a><br />
25
- <a href="files/rghost_barcode/rghost_barcode_base_rb.html">rghost_barcode/rghost_barcode_base.rb</a><br />
26
- <a href="files/rghost_barcode/rghost_barcode_classes_rb.html">rghost_barcode/rghost_barcode_classes.rb</a><br />
27
- <a href="files/rghost_barcode/rghost_barcode_examples_rb.html">rghost_barcode/rghost_barcode_examples.rb</a><br />
28
- <a href="files/rghost_barcode/rghost_barcode_version_rb.html">rghost_barcode/rghost_barcode_version.rb</a><br />
29
- <a href="files/teste_main_rb.html">teste_main.rb</a><br />
30
- </div>
31
- </div>
32
- </body>
33
- </html>
@@ -1,74 +0,0 @@
1
-
2
- <?xml version="1.0" encoding="iso-8859-1"?>
3
- <!DOCTYPE html
4
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
-
7
- <!--
8
-
9
- Methods
10
-
11
- -->
12
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
- <head>
14
- <title>Methods</title>
15
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
- <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
- <base target="docwin" />
18
- </head>
19
- <body>
20
- <div id="index">
21
- <h1 class="section-bar">Methods</h1>
22
- <div id="index-entries">
23
- <a href="classes/RGhost/Barcode/Parameter.html#M000009">add (RGhost::Barcode::Parameter)</a><br />
24
- <a href="classes/RGhost/Barcode/Parameter.html#M000010">add_color (RGhost::Barcode::Parameter)</a><br />
25
- <a href="classes/RGhost/Barcode/Parameter.html#M000011">add_single (RGhost::Barcode::Parameter)</a><br />
26
- <a href="classes/RGhost/Barcode/Parameter.html#M000012">add_with_unit (RGhost::Barcode::Parameter)</a><br />
27
- <a href="classes/RGhost/Document.html#M000023">barcode_auspost (RGhost::Document)</a><br />
28
- <a href="classes/RGhost/Document.html#M000026">barcode_azteccode (RGhost::Document)</a><br />
29
- <a href="classes/RGhost/Document.html#M000018">barcode_code11 (RGhost::Document)</a><br />
30
- <a href="classes/RGhost/Document.html#M000033">barcode_code128 (RGhost::Document)</a><br />
31
- <a href="classes/RGhost/Document.html#M000019">barcode_code2of5 (RGhost::Document)</a><br />
32
- <a href="classes/RGhost/Document.html#M000024">barcode_code39 (RGhost::Document)</a><br />
33
- <a href="classes/RGhost/Document.html#M000038">barcode_code93 (RGhost::Document)</a><br />
34
- <a href="classes/RGhost/Document.html#M000032">barcode_datamatrix (RGhost::Document)</a><br />
35
- <a href="classes/RGhost/Document.html#M000041">barcode_ean13 (RGhost::Document)</a><br />
36
- <a href="classes/RGhost/Document.html#M000043">barcode_ean2 (RGhost::Document)</a><br />
37
- <a href="classes/RGhost/Document.html#M000027">barcode_ean5 (RGhost::Document)</a><br />
38
- <a href="classes/RGhost/Document.html#M000020">barcode_ean8 (RGhost::Document)</a><br />
39
- <a href="classes/RGhost/Config.html#M000016">barcode_examples (RGhost::Config)</a><br />
40
- <a href="classes/RGhost/Document.html#M000044">barcode_interleaved2of5 (RGhost::Document)</a><br />
41
- <a href="classes/RGhost/Document.html#M000017">barcode_isbn (RGhost::Document)</a><br />
42
- <a href="classes/RGhost/Document.html#M000047">barcode_kix (RGhost::Document)</a><br />
43
- <a href="classes/RGhost/Document.html#M000036">barcode_maxicode (RGhost::Document)</a><br />
44
- <a href="classes/RGhost/Document.html#M000039">barcode_msi (RGhost::Document)</a><br />
45
- <a href="classes/RGhost/Document.html#M000042">barcode_onecode (RGhost::Document)</a><br />
46
- <a href="classes/RGhost/Document.html#M000046">barcode_pdf417 (RGhost::Document)</a><br />
47
- <a href="classes/RGhost/Document.html#M000048">barcode_pharmacode (RGhost::Document)</a><br />
48
- <a href="classes/RGhost/Document.html#M000028">barcode_plessey (RGhost::Document)</a><br />
49
- <a href="classes/RGhost/Document.html#M000021">barcode_postnet (RGhost::Document)</a><br />
50
- <a href="classes/RGhost/Document.html#M000035">barcode_qrcode (RGhost::Document)</a><br />
51
- <a href="classes/RGhost/Document.html#M000037">barcode_rationalizedcodabar (RGhost::Document)</a><br />
52
- <a href="classes/RGhost/Document.html#M000029">barcode_raw (RGhost::Document)</a><br />
53
- <a href="classes/RGhost/Document.html#M000031">barcode_royalmail (RGhost::Document)</a><br />
54
- <a href="classes/RGhost/Document.html#M000030">barcode_rss14 (RGhost::Document)</a><br />
55
- <a href="classes/RGhost/Document.html#M000022">barcode_rssexpanded (RGhost::Document)</a><br />
56
- <a href="classes/RGhost/Document.html#M000040">barcode_rsslimited (RGhost::Document)</a><br />
57
- <a href="classes/RGhost/Document.html#M000045">barcode_symbol (RGhost::Document)</a><br />
58
- <a href="classes/RGhost/Document.html#M000034">barcode_upca (RGhost::Document)</a><br />
59
- <a href="classes/RGhost/Document.html#M000025">barcode_upce (RGhost::Document)</a><br />
60
- <a href="classes/RGhost/Barcode/Parameter.html#M000013">inspect (RGhost::Barcode::Parameter)</a><br />
61
- <a href="classes/RGhost/Barcode/Parameter.html#M000015">make (RGhost::Barcode::Parameter)</a><br />
62
- <a href="classes/RGhost/Barcode/Text.html#M000002">make (RGhost::Barcode::Text)</a><br />
63
- <a href="classes/RGhost/Barcode/Guard.html#M000003">make (RGhost::Barcode::Guard)</a><br />
64
- <a href="classes/RGhost/Barcode/Base.html#M000005">make (RGhost::Barcode::Base)</a><br />
65
- <a href="classes/RGhost/Barcode/Border.html#M000001">make (RGhost::Barcode::Border)</a><br />
66
- <a href="classes/RGhost/Barcode/Parameter.html#M000008">map (RGhost::Barcode::Parameter)</a><br />
67
- <a href="classes/RGhost/Barcode/Parameter.html#M000007">new (RGhost::Barcode::Parameter)</a><br />
68
- <a href="classes/RGhost/Barcode/Base.html#M000004">new (RGhost::Barcode::Base)</a><br />
69
- <a href="classes/RGhost/Barcode/Base.html#M000006">ps (RGhost::Barcode::Base)</a><br />
70
- <a href="classes/RGhost/Barcode/Parameter.html#M000014">to_s (RGhost::Barcode::Parameter)</a><br />
71
- </div>
72
- </div>
73
- </body>
74
- </html>
@@ -1,24 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
5
-
6
- <!--
7
-
8
- RDoc Documentation
9
-
10
- -->
11
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
12
- <head>
13
- <title>RDoc Documentation</title>
14
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
15
- </head>
16
- <frameset rows="20%, 80%">
17
- <frameset cols="25%,35%,45%">
18
- <frame src="fr_file_index.html" title="Files" name="Files" />
19
- <frame src="fr_class_index.html" name="Classes" />
20
- <frame src="fr_method_index.html" name="Methods" />
21
- </frameset>
22
- <frame src="files/teste_main_rb.html" name="docwin" />
23
- </frameset>
24
- </html>
@@ -1,192 +0,0 @@
1
-
2
- % --DESC: AusPost 4 State Customer Code
3
- % --EXAM: 5956439111ABA 9
4
- % --EXOP: includetext custinfoenc=character
5
- % --RNDR: renlinear
6
- /auspost {
7
-
8
- 0 begin
9
-
10
- /options exch def % We are given an option string
11
- /useropts options def
12
- /barcode exch def % We are given a barcode string
13
-
14
- /includetext false def % Enable/disable text
15
- /textfont /Courier def
16
- /textsize 10 def
17
- /textyoffset -7 def
18
- /height 0.175 def
19
- /custinfoenc (character) def
20
-
21
- % Parse the input options
22
- options {
23
- token false eq {exit} if dup length string cvs (=) search
24
- true eq {cvlit exch pop exch def} {cvlit true def} ifelse
25
- } loop
26
-
27
- /textfont textfont cvlit def
28
- /textsize textsize cvr def
29
- /textyoffset textyoffset cvr def
30
- /height height cvr def
31
-
32
- % Create an array containing the character mappings
33
- /encs
34
- [ (000) (001) (002) (010) (011) (012) (020) (021)
35
- (022) (100) (101) (102) (110) (111) (112) (120)
36
- (121) (122) (200) (201) (202) (210) (211) (212)
37
- (220) (221) (222) (300) (301) (302) (310) (311)
38
- (312) (320) (321) (322) (023) (030) (031) (032)
39
- (033) (103) (113) (123) (130) (131) (132) (133)
40
- (203) (213) (223) (230) (231) (232) (233) (303)
41
- (313) (323) (330) (331) (332) (333) (003) (013)
42
- (00) (01) (02) (10) (11) (12) (20) (21) (22) (30)
43
- (13) (3)
44
- ] def
45
-
46
- % Create a string of the available characters
47
- /barchars (ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz #) def
48
-
49
- /barlen barcode length def
50
- barcode 0 2 getinterval (11) eq {37} if
51
- barcode 0 2 getinterval (45) eq {37} if
52
- barcode 0 2 getinterval (59) eq {52} if
53
- barcode 0 2 getinterval (62) eq {67} if
54
- /encstr exch string def
55
- /txt barlen 2 sub array def
56
-
57
- % Put start character
58
- encstr 0 encs 74 get putinterval
59
-
60
- % Encode the FCC
61
- 0 1 1 {
62
- /i exch def
63
- encs barcode i 1 getinterval cvi 64 add get
64
- encstr i 2 mul 2 add 3 2 roll putinterval
65
- } for
66
-
67
- % Encode the DPID
68
- 2 1 9 {
69
- /i exch def
70
- encs barcode i 1 getinterval cvi 64 add get
71
- encstr i 2 mul 2 add 3 2 roll putinterval
72
- txt i 2 sub [barcode i 1 getinterval i 2 sub 2 mul 6 add 3.312 mul textyoffset textfont textsize] put
73
- } for
74
-
75
- % Encode the customer information
76
- custinfoenc (numeric) eq {
77
- 0 1 barlen 11 sub {
78
- /i exch def
79
- encs barcode i 10 add 1 getinterval cvi 64 add get
80
- encstr i 2 mul 22 add 3 2 roll putinterval
81
- txt i 8 add [barcode i 10 add 1 getinterval i 2 mul 22 add 3.312 mul textyoffset textfont textsize] put
82
- } for
83
- /ciflen barlen 10 sub 2 mul def
84
- } {
85
- 0 1 barlen 11 sub {
86
- /i exch def
87
- barcode i 10 add 1 getinterval barchars exch search
88
- pop
89
- length /indx exch def
90
- pop pop
91
- /enc encs indx get def
92
- encstr i 3 mul 22 add enc putinterval
93
- txt i 8 add [barcode i 10 add 1 getinterval i 3 mul 22 add 3.312 mul textyoffset textfont textsize] put
94
- } for
95
- /ciflen barlen 10 sub 3 mul def
96
- } ifelse
97
-
98
- % Add any filler characters
99
- 22 ciflen add 1 encstr length 14 sub {
100
- encstr exch encs 75 get putinterval
101
- } for
102
-
103
- % Create the 64x64 Reed-Solomon table
104
- /rstable 64 64 mul array def
105
- rstable 0 [ 64 {0} repeat ] putinterval
106
- rstable 64 [ 0 1 63 {} for ] putinterval
107
- /prev 1 def
108
- 64 {
109
- /next prev 1 bitshift def
110
- next 64 and 0 ne {
111
- /next next 67 xor def
112
- } if
113
- 0 1 63 {
114
- /j exch def
115
- /nextcell {rstable 64 next mul j add} def
116
- nextcell rstable 64 prev mul j add get 1 bitshift put
117
- nextcell get 64 and 0 ne {
118
- nextcell nextcell get 67 xor put
119
- } if
120
- } for
121
- /prev next def
122
- } repeat
123
-
124
- % Calculate the Reed-Solomon codes for triples
125
- /rscodes encstr length 16 sub 3 idiv 4 add array def
126
- rscodes 0 [ 4 {0} repeat ] putinterval
127
- 2 3 encstr length 16 sub {
128
- /i exch def
129
- rscodes rscodes length i 2 sub 3 idiv sub 1 sub
130
- encstr i 1 getinterval cvi 16 mul
131
- encstr i 1 add 1 getinterval cvi 4 mul add
132
- encstr i 2 add 1 getinterval cvi add
133
- put
134
- } for
135
- rscodes length 5 sub -1 0 {
136
- /i exch def
137
- 0 1 4 {
138
- /j exch def
139
- rscodes i j add rscodes i j add get
140
- rstable 64 [48 17 29 30 1] j get mul rscodes i 4 add get add get
141
- xor put
142
- } for
143
- } for
144
- /checkcode (000000000000) 12 string copy def
145
- 0 1 3 {
146
- /i exch def
147
- /enc rscodes 3 i sub get 4 3 string cvrs def
148
- checkcode i 3 mul 3 enc length sub add enc putinterval
149
- } for
150
-
151
- % Put checkcode and end characters
152
- encstr encstr length 14 sub checkcode putinterval
153
- encstr encstr length 2 sub encs 74 get putinterval
154
-
155
- /bbs encstr length array def
156
- /bhs encstr length array def
157
- 0 1 encstr length 1 sub {
158
- /i exch def
159
- /enc encstr i 1 getinterval def
160
- enc (0) eq {
161
- bbs i 0 height mul 8 div put
162
- bhs i 8 height mul 8 div put
163
- } if
164
- enc (1) eq {
165
- bbs i 3 height mul 8 div put
166
- bhs i 5 height mul 8 div put
167
- } if
168
- enc (2) eq {
169
- bbs i 0 height mul 8 div put
170
- bhs i 5 height mul 8 div put
171
- } if
172
- enc (3) eq {
173
- bbs i 3 height mul 8 div put
174
- bhs i 2 height mul 8 div put
175
- } if
176
- } for
177
-
178
- /retval 8 dict def
179
- retval (ren) (renlinear) put
180
- retval (bbs) bbs put
181
- retval (bhs) bhs put
182
- retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put
183
- includetext {
184
- retval (txt) txt put
185
- } if
186
- retval (opt) useropts put
187
- retval
188
-
189
- end
190
-
191
- } bind def
192
- /auspost load 0 1 dict put
@@ -1,357 +0,0 @@
1
-
2
- % --DESC: Aztec Code
3
- % --EXAM: 00100111001000000101001101111000010100111100101000000110
4
- % --EXOP: format=compact
5
- % --RNDR: renmatrix
6
- /azteccode {
7
-
8
- 0 begin
9
-
10
- /options exch def
11
- /useropts options def
12
- /barcode exch def
13
-
14
- /format (unset) def % full, compact or rune
15
- /readerinit false def
16
- /layers -1 def
17
- /eclevel 23 def
18
- /ecaddchars 3 def
19
-
20
- % Parse the input options
21
- options {
22
- token false eq {exit} if dup length string cvs (=) search
23
- true eq {cvlit exch pop exch def} {cvlit true def} ifelse
24
- } loop
25
-
26
- /layers layers cvi def
27
- /eclevel eclevel cvr def
28
- /ecaddchars ecaddchars cvi def
29
-
30
- % Convert from input into message bitstream
31
- /msgbits () def
32
- format (rune) ne {/msgbits barcode def} if
33
-
34
- % Lookup the most appropriate symbol specification
35
- /metrics [
36
- [ (rune) 0 0 0 6 ] % Special metric for rune symbols
37
- [ (compact) 1 1 17 6 ] [ (full) 1 1 21 6 ] [ (compact) 2 0 40 6 ]
38
- [ (full) 2 1 48 6 ] [ (compact) 3 0 51 8 ] [ (full) 3 1 60 8 ]
39
- [ (compact) 4 0 76 8 ] [ (full) 4 1 88 8 ] [ (full) 5 1 120 8 ]
40
- [ (full) 6 1 156 8 ] [ (full) 7 1 196 8 ] [ (full) 8 1 240 8 ]
41
- [ (full) 9 1 230 10 ] [ (full) 10 1 272 10 ] [ (full) 11 1 316 10 ]
42
- [ (full) 12 1 364 10 ] [ (full) 13 1 416 10 ] [ (full) 14 1 470 10 ]
43
- [ (full) 15 1 528 10 ] [ (full) 16 1 588 10 ] [ (full) 17 1 652 10 ]
44
- [ (full) 18 1 720 10 ] [ (full) 19 1 790 10 ] [ (full) 20 1 864 10 ]
45
- [ (full) 21 1 940 10 ] [ (full) 22 1 1020 10 ] [ (full) 23 0 920 12 ]
46
- [ (full) 24 0 992 12 ] [ (full) 25 0 1066 12 ] [ (full) 26 0 1144 12 ]
47
- [ (full) 27 0 1224 12 ] [ (full) 28 0 1306 12 ] [ (full) 29 0 1392 12 ]
48
- [ (full) 30 0 1480 12 ] [ (full) 31 0 1570 12 ] [ (full) 32 0 1664 12 ]
49
- ] def
50
-
51
- /i 0 def
52
- { % loop
53
- /m metrics i get def
54
- /frmt m 0 get def % Format of the symbol
55
- /mlyr m 1 get def % Data layers
56
- /icap m 2 get def % Reader initialisation capable
57
- /ncws m 3 get def % Total of codewords
58
- /bpcw m 4 get def % Bits per codeword
59
- /numecw ncws eclevel mul 100 div ecaddchars add ceiling cvi def
60
- msgbits length 0 eq {/numecw 0 def} if % Error correction codewords
61
- /numdcw ncws numecw sub def % Data codewords
62
- /okay true def
63
- format (unset) ne format frmt ne and {/okay false def} if
64
- readerinit icap 1 ne and {/okay false def} if
65
- layers -1 ne layers mlyr ne and {/okay false def} if
66
- msgbits length bpcw div ceiling cvi numdcw gt {/okay false def} if
67
- okay {exit} if
68
- /i i 1 add def
69
- } loop
70
- /layers mlyr def
71
- /format frmt def
72
-
73
- % Expand message bits into codewords avoiding codewords with all zeros or all ones
74
- /allzero {dup length (000000000000) 0 3 -1 roll getinterval eq} bind def
75
- /allones {dup length (111111111111) 0 3 -1 roll getinterval eq} bind def
76
- /cws ncws array def
77
- /m 0 def /c 0 def
78
- {
79
- msgbits length m le {exit} if
80
- msgbits length m sub bpcw ge {
81
- /cwb msgbits m bpcw 1 sub getinterval def % All but last bit
82
- /cwf msgbits m bpcw add 1 sub 1 getinterval def % Last bit
83
- cwb allzero {/cwf (1) def /m m 1 sub def} if % Flip last bit to avoid zeros
84
- cwb allones {/cwf (0) def /m m 1 sub def} if % Flip last bit to avoid ones
85
- % Concatinate the bits
86
- 12 string dup 0 cwb putinterval
87
- dup bpcw 1 sub cwf putinterval
88
- 0 bpcw getinterval
89
- /cwb exch def
90
- } { % Final codeword
91
- /cwb msgbits m msgbits length m sub getinterval def
92
- /cwb (111111111111) 12 string copy dup 0 cwb putinterval 0 bpcw getinterval def
93
- cwb allones {cwb cwb length 1 sub (0) putinterval} if % Prevent all ones
94
- } ifelse
95
- % Conversion of binary data into byte array
96
- /cw 0 def
97
- 0 1 bpcw 1 sub {
98
- /i exch def
99
- /cw cw 2 bpcw i sub 1 sub exp cvi cwb i get 48 sub mul add def
100
- } for
101
- cws c cw put
102
- /m m bpcw add def
103
- /c c 1 add def
104
- } loop
105
- /cws cws 0 c getinterval def
106
-
107
- % Reed-Solomon algorithm
108
- /rscodes {
109
-
110
- /rspm exch def
111
- /rsgf exch def
112
- /rsnc exch def
113
- /rscws exch def
114
-
115
- % Calculate the log and anti-log tables
116
- /rslog [ 1 rsgf sub rsgf 1 sub {0} repeat ] def
117
- /rsalog [ 1 rsgf 1 sub {0} repeat ] def
118
- 1 1 rsgf 1 sub {
119
- /i exch def
120
- rsalog i rsalog i 1 sub get 2 mul put
121
- rsalog i get rsgf ge { rsalog i rsalog i get rspm xor put } if
122
- rslog rsalog i get i put
123
- } for
124
-
125
- % Function to calculate the product in the field
126
- /rsprod {
127
- /y exch def
128
- /x exch def
129
- x y mul 0 ne {
130
- rsalog rslog x get rslog y get add rsgf 1 sub mod get
131
- } {
132
- 0
133
- } ifelse
134
- } bind def
135
-
136
- % Generate the coefficients
137
- /coeffs [ 1 rsnc {0} repeat ] def
138
- 1 1 rsnc {
139
- /i exch def
140
- coeffs i coeffs i 1 sub get put
141
- i 1 sub -1 1 {
142
- /j exch def
143
- coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put
144
- } for
145
- coeffs 0 coeffs 0 get rsalog i get rsprod put
146
- } for
147
-
148
- % Extend the input with the error correction values
149
- /nd rscws length def
150
- /rscws [ rscws {} forall rsnc {0} repeat 0 ] def
151
- 0 1 nd 1 sub {
152
- /k exch rscws exch get rscws nd get xor def
153
- 0 1 rsnc 1 sub {
154
- /j exch def
155
- rscws nd j add rscws nd j add 1 add get k coeffs rsnc j sub 1 sub get rsprod xor put
156
- } for
157
- } for
158
-
159
- % Return all but the last codeword
160
- rscws 0 rscws length 1 sub getinterval
161
-
162
- } bind def
163
-
164
- % Create the codewords and bit string for the mode
165
- format (full) eq {
166
- /mode layers 1 sub 11 bitshift cws length 1 sub add def
167
- readerinit {/mode mode 2#1000000000000000 or def} if
168
- /mode [
169
- mode 2#1111000000000000 and -12 bitshift
170
- mode 2#0000111100000000 and -8 bitshift
171
- mode 2#0000000011110000 and -4 bitshift
172
- mode 2#0000000000001111 and
173
- ] def
174
- /mode mode 6 16 19 rscodes def
175
- } if
176
- format (compact) eq {
177
- /mode layers 1 sub 6 bitshift cws length 1 sub add def
178
- readerinit {/mode mode 2#10000000 or def} if
179
- /mode [
180
- mode 2#11110000 and -4 bitshift
181
- mode 2#00001111 and
182
- ] def
183
- /mode mode 5 16 19 rscodes def
184
- } if
185
- format (rune) eq {
186
- /mode barcode cvi def
187
- /mode [
188
- mode 2#11110000 and -4 bitshift
189
- mode 2#00001111 and
190
- ] def
191
- /mode mode 5 16 19 rscodes def
192
- /mode [mode {2#1010 xor} forall] def % Invert alternate bits
193
- } if
194
- /modebits mode length 4 mul string def
195
- 0 1 modebits length 1 sub {modebits exch (0) putinterval} for
196
- 0 1 mode length 1 sub {
197
- /i exch def
198
- modebits mode i get 2 4 string cvrs dup length 4 exch sub 4 i mul add exch putinterval
199
- } for
200
-
201
- % Extend the data codewords with error correction codewords to create the bit string for the data
202
- /rsparams [
203
- [] [] [] [] [] []
204
- [ 64 67 ] % 6-bit codewords
205
- []
206
- [ 256 301 ] % 8-bit codewords
207
- []
208
- [ 1024 1033 ] % 10-bit codewords
209
- []
210
- [ 4096 4201 ] % 12-bit codewords
211
- ] def
212
- /cws cws ncws cws length sub rsparams bpcw get {} forall rscodes def
213
- format (full) eq {
214
- /databits layers layers mul 16 mul layers 112 mul add string def
215
- } {
216
- /databits layers layers mul 16 mul layers 88 mul add string def
217
- } ifelse
218
- 0 1 databits length 1 sub {databits exch (0) putinterval} for
219
- 0 1 ncws 1 sub {
220
- /i exch def
221
- databits cws i get 2 bpcw string cvrs
222
- dup length bpcw exch sub bpcw i mul add databits length ncws bpcw mul sub add
223
- exch putinterval
224
- } for
225
-
226
- % Move to a point in the cartesian plane centered on the bullseye
227
- /cmv {size mul sub mid add} bind def
228
-
229
- % Move to a bit position within a layer
230
- /lmv {
231
- /lbit exch def
232
- /llyr exch def
233
- /lwid fw llyr 4 mul add def
234
- /ldir lbit 2 idiv lwid idiv def
235
- ldir 0 eq { % Top
236
- lwid 1 sub 2 idiv neg 1 add lbit 2 idiv lwid mod add
237
- fw 1 sub 2 idiv llyr 2 mul add lbit 2 mod add
238
- cmv
239
- } if
240
- ldir 1 eq { % Right
241
- fw 2 idiv llyr 2 mul add lbit 2 mod add
242
- lwid 1 sub 2 idiv 1 sub lbit 2 idiv lwid mod sub
243
- cmv
244
- } if
245
- ldir 2 eq { % Bottom
246
- lwid 2 idiv neg 1 add lbit 2 idiv lwid mod add neg
247
- fw 2 idiv llyr 2 mul add lbit 2 mod add neg
248
- cmv
249
- } if
250
- ldir 3 eq { % Left
251
- fw 1 sub 2 idiv llyr 2 mul add lbit 2 mod add neg
252
- lwid 2 idiv 1 sub lbit 2 idiv lwid mod sub neg
253
- cmv
254
- } if
255
- } bind def
256
-
257
- % Create the pixel map
258
- % For full symbols we disregard the reference grid at this stage
259
- format (full) eq {/fw 12 def} {/fw 9 def} ifelse
260
- /size fw layers 4 mul add 2 add def
261
- /pixs [size size mul {-1} repeat] def
262
- /mid size 1 sub 2 idiv size mul size 1 sub 2 idiv add def
263
-
264
- % Data layers
265
- /i 0 def
266
- 1 1 layers {
267
- /layer exch def
268
- 0 1 fw layer 4 mul add 8 mul 1 sub {
269
- /pos exch def
270
- pixs layer pos lmv databits databits length i sub 1 sub get 48 sub put
271
- /i i 1 add def
272
- } for
273
- } for
274
-
275
- % For full symbols expand the pixel map by inserting the reference grid
276
- format (full) eq {
277
- /fw 13 def
278
- /size fw layers 4 mul add 2 add layers 10.5 add 7.5 div 1 sub cvi 2 mul add def
279
- /mid size size mul 2 idiv def
280
- /npixs [size size mul {-2} repeat] def
281
- 0 16 size 2 idiv {
282
- /i exch def
283
- 0 1 size 1 sub {
284
- /j exch def
285
- npixs size 2 idiv neg j add i cmv [size 2 idiv j add i add 1 add 2 mod] putinterval
286
- npixs size 2 idiv neg j add i neg cmv [size 2 idiv j add i add 1 add 2 mod] putinterval
287
- npixs i size 2 idiv neg j add cmv [size 2 idiv j add i add 1 add 2 mod] putinterval
288
- npixs i neg size 2 idiv neg j add cmv [size 2 idiv j add i add 1 add 2 mod] putinterval
289
- } for
290
- } for
291
- /j 0 def
292
- 0 1 npixs length 1 sub {
293
- /i exch def
294
- npixs i get -2 eq {
295
- npixs i pixs j get put
296
- /j j 1 add def
297
- } if
298
- } for
299
- /pixs npixs def
300
- } if
301
-
302
- % Finder pattern
303
- /fw fw 2 idiv def
304
- fw neg 1 fw {
305
- /i exch def
306
- fw neg 1 fw {
307
- /j exch def
308
- pixs i j cmv
309
- i abs j abs gt {i abs} {j abs} ifelse 1 add 2 mod
310
- put
311
- } for
312
- } for
313
-
314
- % Orientation bits
315
- [ [ fw 1 add neg fw 1 ] [ fw 1 add neg fw 1 add 1 ]
316
- [ fw neg fw 1 add 1 ] [ fw 1 add fw 1 add 1 ]
317
- [ fw 1 add fw 1 ] [ fw 1 add fw neg 1 ]
318
- [ fw fw 1 add 0 ] [ fw 1 add fw 1 add neg 0 ]
319
- [ fw fw 1 add neg 0 ] [ fw neg fw 1 add neg 0 ]
320
- [ fw 1 add neg fw 1 add neg 0 ] [ fw 1 add neg fw neg 0 ]
321
- ] {pixs exch {} forall 3 1 roll cmv exch put} forall
322
-
323
- % Mode ring
324
- format (full) eq {
325
- /modemap [
326
- [-5 7] [-4 7] [-3 7] [-2 7] [-1 7] [ 1 7] [ 2 7] [ 3 7] [ 4 7] [ 5 7]
327
- [ 7 5] [ 7 4] [ 7 3] [ 7 2] [ 7 1] [ 7 -1] [ 7 -2] [ 7 -3] [ 7 -4] [ 7 -5]
328
- [ 5 -7] [ 4 -7] [ 3 -7] [ 2 -7] [ 1 -7] [-1 -7] [-2 -7] [-3 -7] [-4 -7] [-5 -7]
329
- [-7 -5] [-7 -4] [-7 -3] [-7 -2] [-7 -1] [-7 1] [-7 2] [-7 3] [-7 4] [-7 5]
330
- ] def
331
- } {
332
- /modemap [
333
- [-3 5] [-2 5] [-1 5] [ 0 5] [ 1 5] [ 2 5] [ 3 5]
334
- [ 5 3] [ 5 2] [ 5 1] [ 5 0] [ 5 -1] [ 5 -2] [ 5 -3]
335
- [ 3 -5] [ 2 -5] [ 1 -5] [ 0 -5] [-1 -5] [-2 -5] [-3 -5]
336
- [-5 -3] [-5 -2] [-5 -1] [-5 0] [-5 1] [-5 2] [-5 3]
337
- ] def
338
- } ifelse
339
- 0 1 modemap length 1 sub {
340
- /i exch def
341
- pixs modemap i get {} forall cmv modebits i get 48 sub put
342
- } for
343
-
344
- /retval 7 dict def
345
- retval (ren) (renmatrix) put
346
- retval (pixs) pixs put
347
- retval (pixx) size put
348
- retval (pixy) size put
349
- retval (height) size 2 mul 72 div put
350
- retval (width) size 2 mul 72 div put
351
- retval (opt) useropts put
352
- retval
353
-
354
- end
355
-
356
- } bind def
357
- /azteccode load 0 1 dict put