From 3aad4a6aa4b9963d63d02365503cd81a9ad0ed0c Mon Sep 17 00:00:00 2001 From: Guilherme Folego Date: Mon, 9 Oct 2017 21:22:50 -0300 Subject: [PATCH] Update to PostScript version --- README.md | 7 ++-- res/1.pdf | Bin 3313 -> 0 bytes res/7.pdf | Bin 3343 -> 0 bytes res/8.pdf | Bin 2851 -> 0 bytes src/faas.sh | 44 +++++--------------- src/process.py | 111 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 125 insertions(+), 37 deletions(-) delete mode 100644 res/1.pdf delete mode 100644 res/7.pdf delete mode 100644 res/8.pdf create mode 100644 src/process.py diff --git a/README.md b/README.md index 4bea450..7c4f0ba 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Please note that this is *saturday afternoon* quality code, *i.e.*, it is primar ### Requirements ```bash -sudo apt-get install file poppler-utils bc pdfjam pdftk +sudo apt-get install file poppler-utils bc ghostscript python ``` ### Using @@ -24,5 +24,6 @@ bash src/faas.sh example/input.pdf example/output.pdf - Add personal handwriting style for numbers - Add some stochastic variations -### Extra -Images in `res` directory were taken from [https://www.1001freedownloads.com/free-cliparts/?order=new&tag=handwritten](https://www.1001freedownloads.com/free-cliparts/?order=new&tag=handwritten), and converted to PDF with `inkscape --without-gui --export-pdf=1.pdf 1.svg` (for each file). +### Contributors (in alphabetical order) +- Bruno Ribeiro +- Guilherme Folego (gfolego@gmail.com) diff --git a/res/1.pdf b/res/1.pdf deleted file mode 100644 index eaee09110381d491e8dc2719e329c3a3ae13d56e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3313 zcma)9XIN9&7Nv>?X-Y4073o3}LLgL2DAJT(CQ@Pu5LzG!T>(ci(nLohDk{DAA}B*B ziZFDfMXFNStbF9B7$qP_tK-M4t0Ki5#UlNwUn0?VCtN|8-cgKSC^+7}u0gLtnh2Hmb zLY4Yy@oc$fy_7*5y}m5I2YCXOxgO2uwsRoRPHQ&Wa%{MwN>V;>D?jwhvSQlWC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3rx)tYx6BHAhlMB?bAwxsbglBev&SskQSVLOlcAE6m&c@dIIv@KLQyCD}-~F2jV>~hK z8`HBfXNGH2Q&-bq1~8XuKiu7}pEC?48QYK;UJlUJWde)=Mnf120E|2dKmjlY&A2lh z9^(b$&bYqif&a(@fNjG9umIQ+?TOvZX^AFa{Yi{%-%Xt z2H?CKjl}zt7~w>K={vugOk)B*DBu@DU-R#x-#OYasuIxt!~kY3OxSnW1RxQDc3Cim zAQ@2x*kBw6Yi)dr8S+&J*cwa32N5t>BEUQi>t9qcIe+)QKUEQTiJIZui3|ly;nqL6 z2Qh{Il0f5^1W1M_CgBNy0tSsE-~p&AR9#gAQ1Bv=0<^)5gJpo81ayEG4ntJM6Fe0a zcgt83@a{nvhR6Q@xBcvj<}c;H@<*acXkWbN*VK#-5x@22=blgk)&m3q5Fp5p0cgPC zFgV}=e8bcbYK+Xx0r>yG;OdOi`ZorFKpDsLZ%hpiMf?w@0cCXizv2*DjBflJgF&EL zKQR&kjq}A4c7IH4aN$@6WoDPH@puxz6#n(&G4c1n1I#w;_LWFN6G*!XVGvCyNLJSH HtP$uxXtbwL diff --git a/res/7.pdf b/res/7.pdf deleted file mode 100644 index bd2bbaa6ecfcf63a71465ac0bf75bec9cde8a552..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3343 zcma)9c|25Y8zvPdORq#^IbNA;nZb<6P>dyvB}+qyF*A&HG{%~>gqLKAB3riC7AZ~H z%KBnZvV`m*qHH0%z8S6W_xToyf!@u`~{dk1ccQnzz!FGX2v|5fs8*cN+JcFOFlAH{ojYb|4; zW+(gk*X@qBsm)|!#%|fY=U@E>1S{yt>C_l1gt*T~`WY3_;i*n(%;{vYz+z?U!krBn;oB;;K%@Md0} z)Nh&#w|cI_->m|d?7_1M-?Xhr?mwz|QobId^Eqwc$?D~sVrJ88%fpo>S@+McA5dUW z3l&?+jq{tvf{LqEntIWe`eB_7kLx)&Jt-3Y*^9pDYAd3@!Z2=bja1=X{2``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uB-mO z@PJ-;t?3x&jG>ad+=)P82l>@~ybu-T?gtKn&^sdV)1D8NCd8en(wyb#%UIpq8Jui& zt&{46aEqQmWh5Koopiaq*`Q&uRM$>I>nF3&cQRMUI43b@GclfWZLjvLOoY@Q>g7o} zR0y?hSK_+cZQ;a)VR5J#Euk8h-8j9!y;I(ni0=WdS~qnQ2MU)KjF|VuSW;tLi=K)S zI_-)Mc3o_yyf1tECS6^AYEW&zf6w1`RZOluUYg z`Gv>l{H^<R{xbqJaS+0W)jtNmq89vfIp&H9h70ae6i4?UgP}R+Fnp4woR^>#O;J zUr!`7Z%=>S(OuC#(ZOaF^qjRqE}VKUZ$R-~he==`8#cI*tvXCqqbVux*!oIV%e{cY zjUu}~RI$&|eaSUkyGtaE)a0zHO1HB4w;_wI*uG>C316nVQ)c-e zrRZq8U_ZcJ-?JN3y}P>!37N9=2I1Xs-z^&LiEi%bj*dRlJe?d2u0RiUt01OTTtoNdkL^m=m+ykJy(r*@2 zn?&?<|E-~K`S;KtJ(|#}k}z%_?(|w%-yg6JKqh(abwMYBq(y1qy&SQ4V{LVM$TuDk zW4s5^lZ3^40QA!^{*4vA=O51a7b}mwM)e$V9yA7Y;>JIF_oNg3ErG&s36M0$OeT^5 zaV*A>L%zxMc$@b(}mpa_Eg9Do8GE)NInf$x}{BAk|)J^;6$ z82mKtwEm4jp|Z5&`8Os9hbjIKrU0X<{aVm^k|3 tX)V)LHYO6u0G;@^k4MMNo(Rxo*wfX6j3JTt7|P2+WkF(Mnuc1S{{RmT$SD8- diff --git a/res/8.pdf b/res/8.pdf deleted file mode 100644 index 0259a44f4c83528b162f0fa51c87edc4423e5787..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2851 zcma)8c{r478xMsur|e9ps5eUtGBXUa4B7W>m}GAnuQ6FhGlQ`tb@G*nWG!k!S(B9I z6jIV8q#=iFBYT#qPEp8L73`={h=Zn+1ofq^O2 zaBr-@v;Y)9Idm9iXb2$f!B7%C5WqkX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<@g2D)`l2;$LLf7IT)m_OIcTPGzg{4t1^y4p#wbPUoVeMXaEJ^m0`WEG&+GwUuUSP OgVKX3DOosK!u|^i_qQVe diff --git a/src/faas.sh b/src/faas.sh index 8a1aea2..74d6824 100644 --- a/src/faas.sh +++ b/src/faas.sh @@ -25,16 +25,6 @@ # "1" for debug DEBUG="0" -# Offset for pdfjam -OFFSET8="-225" -OFFSET1="-115" -OFFSET7="-108" - -# Scale for pdfjam -SCALE8="0.035" -SCALE1="0.03" -SCALE7="0.03" - ################## @@ -85,9 +75,9 @@ fi [[ "$DEBUG" == "1" ]] && echo "Temp dir: $tmpdir" -# Resources directory -resdir="$(dirname "$0")/../res" -[[ "$DEBUG" == "1" ]] && echo "Res bir: $resdir" +# Source directory +srcdir="$(dirname "$0")/" +[[ "$DEBUG" == "1" ]] && echo "Src bir: $srcdir" @@ -109,30 +99,16 @@ pos=($(pdftotext "$infile" -bbox /dev/stdout | grep ">-----" -B1 | grep ">[0-9][0-9]" | cut -f4,8 -d\" | sed s,\",+, | bc | - xargs -i echo "$size"*0.5-{}*0.5 | bc )) + xargs -i echo "$size"-{}*0.5 | bc )) [[ "$DEBUG" == "1" ]] && printf "Pos: %s\n" "${pos[@]}" +# Process +inputps="$tmpdir"/input.ps +outputps="$tmpdir"/output.ps -# Create a PDF for each entry -for i in ${!pos[@]}; do - pdfjam --quiet --scale "$SCALE8" --offset "$OFFSET8 ${pos[i]}" "$resdir"/8.pdf --outfile "$tmpdir"/jam8-"$i".pdf - pdfjam --quiet --scale "$SCALE1" --offset "$OFFSET1 ${pos[i]}" "$resdir"/1.pdf --outfile "$tmpdir"/jam1-"$i".pdf - pdfjam --quiet --scale "$SCALE7" --offset "$OFFSET7 ${pos[i]}" "$resdir"/7.pdf --outfile "$tmpdir"/jam7-"$i".pdf -done - -# Separate input pages -pdftk "$infile" cat 1 output "$tmpdir"/stamp-0.pdf -pdftk "$infile" cat 2 output "$tmpdir"/back.pdf - -# Combine entries -for i in ${!pos[@]}; do - pdftk "$tmpdir"/jam8-"$i".pdf stamp "$tmpdir"/jam1-"$i".pdf output "$tmpdir"/tmp-"$i".pdf - pdftk "$tmpdir"/tmp-"$i".pdf stamp "$tmpdir"/jam7-"$i".pdf output "$tmpdir"/jamall-"$i".pdf - pdftk "$tmpdir"/stamp-"$i".pdf stamp "$tmpdir"/jamall-"$i".pdf output "$tmpdir"/stamp-"$((i+1))".pdf -done - -# Generate final file -pdfunite "$tmpdir"/stamp-${#pos[@]}.pdf "$tmpdir"/back.pdf "$outfile" +pdf2ps "$infile" "$inputps" +python "$srcdir"/process.py "$inputps" "$outputps" "${pos[@]}" +ps2pdf "$outputps" "$outfile" # Clean up [[ "$DEBUG" != "1" ]] && rm -rf "$tmpdir" diff --git a/src/process.py b/src/process.py new file mode 100644 index 0000000..43e76bf --- /dev/null +++ b/src/process.py @@ -0,0 +1,111 @@ +#!/usr/bin/python + + +# process.py +# Copyright 2017 +# Bruno Ribeiro +# Guilherme Folego (gfolego@gmail.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +import sys +import argparse + + +def parse_args(argv): + parser = argparse.ArgumentParser() + + parser.add_argument('infile', metavar='input.ps', type=argparse.FileType('r'), + help='input PostScript file') + parser.add_argument('outfile', metavar='output.ps', type=argparse.FileType('w'), + help='output PostScript file') + parser.add_argument('pos', metavar='position', type=float, nargs='+', + help='positions for time entries') + parser.add_argument('-d', '--debug', action='store_true', + help='activate debug mode') + parser.add_argument('--start-string', help='string to be used as start time') + parser.add_argument('--end-string', help='string to be used as end time') + + + args = parser.parse_args(args=argv) + return args + + +def process(infile, outfile, pos, startstr, endstr, debug=False): + content = infile.read() + + if (startstr == None): + startstr = '08:00' + if (endstr == None): + endstr = '17:00' + + pos1 = content.find("COLABORADOR)Tj") + pos2 = content.rfind("<>stream\n") + outfile.write(content) + outfile.write(lastPart) + + +# Main +def main(argv): + + # Parse arguments + args = parse_args(argv) + if args.debug: print(args) + + process(args.infile, args.outfile, args.pos, args.start_string, args.end_string, args.debug) + + +if __name__ == "__main__": + main(sys.argv[1:]) +