summaryrefslogtreecommitdiffstats
path: root/generation/passlist.rb
diff options
context:
space:
mode:
authorHolger Cremer <HolgerCremer@gmail.com>2019-04-05 18:01:28 +0200
committerHolger Cremer <HolgerCremer@gmail.com>2019-04-05 18:01:28 +0200
commitd92aa9d79a3f80557119b660f7191e96b7d79878 (patch)
treece31b694a0f2604ea16a9ae5580426ea666941ba /generation/passlist.rb
parent61b2f90b4940d715d435898b38f11c37c3720607 (diff)
downloadserial-barcode-scanner-d92aa9d79a3f80557119b660f7191e96b7d79878.tar.bz2
Several pdf generation improvements.
- 2 scripts to create barcodes - "joined add" parameter to create partial lists for updates - a dockerfile to easy creation
Diffstat (limited to 'generation/passlist.rb')
-rw-r--r--generation/passlist.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/generation/passlist.rb b/generation/passlist.rb
index cb02bd1..9702762 100644
--- a/generation/passlist.rb
+++ b/generation/passlist.rb
@@ -22,7 +22,7 @@ require "csv"
\begin{document}
\begin{center}
\begin{longtable}{| >{\centering\arraybackslash}p{8.5cm}| >{\centering\arraybackslash}p{8.5cm}| >{\centering\arraybackslash}p{8.5cm}|}
- %s
+ %s
\end{longtable}
\end{center}
\end{document}}
@@ -36,13 +36,13 @@ require "csv"
@graphics = %q{ \includegraphics{%s} \rule{0cm}{3.5cm} %s}
@name = %q{ %s %s %s}
-@ktt = %q{\includegraphics[width=8cm,angle=180]{ktt} %s }
+@ktt = %q{\includegraphics[width=8cm,angle=180]{../ktt} %s }
@csv = CSV.read(ARGV[0])
#generate barcodes
-@csv.each{|r|
- system("barcode -n -E -b 'USER %s' -o '%s.eps' -e 39\n" % [r[0], r[0]])
+@csv.each{|r|
+ system("barcode -n -E -b 'USER %s' -o 'passlist/%s.eps' -e 39\n" % [r[0], r[0]])
}
#generate latex
@@ -54,8 +54,8 @@ name = ""
sign = le ? "\\\\" : "&"
graphics += @graphics % [@csv[i-1][0], sign]
name += @name % [@csv[i-1][1], @csv[i-1][2], sign]
- if le
- tmp += @line % [graphics, name]
+ if le
+ tmp += @line % [graphics, name]
graphics = ""
name = ""
1.upto(3) {|j|
@@ -68,4 +68,4 @@ name = ""
name = ""
end
}
-File.open("barcode.latex", "w+"){|f| f.write(@template % tmp)}
+File.open("passlist/passlist.latex", "w+"){|f| f.write(@template % tmp)}