I would like to use latex to write cheques as perfect word placement is only possible with it. For this, I would require to do following things
- Set page size to cheque size
- Write current date in boxes on right top position
- Write payee name above a line provided
- Put the amount on left side in a box
- Expand the amount to word on write side
Does anyone have attempted this. Kindly provide a solution if anyone has. MWE documents placement, but digits need to be expanded to the words. Date should occupy the boxes provided and I should be able to fill this template using csv data data.csv is here
Name, Amount
John Doe, 1000000
MWE:
\documentclass{memoir}
\usepackage[pageheight= 94mm, pagewidth=195mm]{geometry}
%\setstocksize{94mm}{195mm}
\usepackage{tikz}
\usepackage[utf8]{inputenc}
\newcommand\PlaceText[3]{%
\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,inner sep=0pt,anchor=south west]
at ([xshift=#1,yshift=-#2]current page.north west) {#3};
\end{tikzpicture}%
}
%%number to words
\newcommand\majorUnit{Rupees}
\newcommand\minorUnit{Paisa}
\newcommand\spellOutCurrency[2]{%
\NumToName{#1},\majorUnit\ and \NumToName{#2},\minorUnit%
}
% Load data from csv
\usepackage{datatool}
% Use custom date format
\usepackage{datetime,calc,tokcycle}
\Characterdirective{\addcytoks{#1\ }}
\newcommand{\customtoday}{\expandedtokcyclexpress
{\twodigit{\the\day}\twodigit{\the\month}\the\year}\the\cytoks\unskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Load data.csv
\DTLloaddb{list}{data.csv}
\DTLforeach{list}{%
\Name=Name,\Amount=Amount}
{\newpage
\thispagestyle{plain}
\PlaceText{15 cm}{0.75 cm}{ \customtoday}
\PlaceText{ 2 cm }{ 2 cm }{\Name }
\PlaceText{2 cm }{3.5 cm}{\spellOutCurrency{\Amount}{00}}
\PlaceText{15 cm}{3.8cm}{\Amount}
}
\end{document}
geometrypackage to set pge size and no margins, usetikzto perfectly position some item on page, and even some package likemailmergeto repeat the cheque output if you have a list of people to give cheques. – Miguel V. S. Frasson Feb 10 '22 at 17:44