feat: init
This commit is contained in:
commit
a957f6c29f
11
create_watermark.sh
Executable file
11
create_watermark.sh
Executable file
@ -0,0 +1,11 @@
|
||||
input_pdf=$1
|
||||
watermark=$2
|
||||
new_pdf="${input_pdf::-4}_watermarked.pdf"
|
||||
|
||||
# create watermark template
|
||||
cd ~/Documents/prog/latex/watermark/
|
||||
sed -i 's/\(\\def\\watermark{\).*}/\1'"${watermark}"'}/g' watermark_template.tex
|
||||
latexmk -pdf watermark_template.tex > /dev/null
|
||||
|
||||
cd -
|
||||
pdftk $input_pdf multistamp ~/Documents/prog/latex/watermark/watermark_template.pdf output $new_pdf
|
30
watermark_template.tex
Normal file
30
watermark_template.tex
Normal file
@ -0,0 +1,30 @@
|
||||
\documentclass{article}
|
||||
\usepackage{tikz}
|
||||
\usepackage{calc}
|
||||
\usepackage[letterpaper,top=0cm,bottom=0cm,left=0cm,right=0cm,marginparwidth=1.75cm]{geometry}
|
||||
\begin{document}
|
||||
|
||||
\def\watermark{Exclusivement destiné à la location}
|
||||
|
||||
\newlength{\watermarklength}
|
||||
\setlength{\watermarklength}{\widthof{\watermark}}
|
||||
|
||||
\def\step{\the\watermarklength}
|
||||
|
||||
\def\startX{-20}
|
||||
\def\stepX{-16}
|
||||
% \def\stepX{\pgfmathparse{\step+\startX}\pgfmathresult$}
|
||||
\def\startY{-30}
|
||||
\def\stepY{-26}
|
||||
% \def\stepY{\pgfmathparse{\step+\startY}\pgfmathresult$}
|
||||
% \def\stepY{8}
|
||||
|
||||
\begin{tikzpicture}[remember picture,overlay]
|
||||
|
||||
\foreach \x in {\startX,\stepX,...,20} {
|
||||
\foreach \y in {\startY,\stepY,...,20} {
|
||||
\node[opacity=0.3, scale=1, rotate=45] at (\x, \y) {\watermark};
|
||||
}
|
||||
}
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user