0

I am trying to use eforms to create a pdf where digital signature can be applied. Each document may have more than one digital signature field, i.e so the document can be passed from person to person. I came across a topic on the same manner in Locking Fields in Digital Signature. I have tried to use the code but the package xcolor doesn't seem to work properly

\documentclass{article}

\usepackage{varwidth}
\usepackage{hyperref}
\usepackage[pdftex]{eforms}
\usepackage{xcolor}

\usepackage{xifthen}

\def\colFeat{blue!50!black} %Feature Color 1 for Main Color Theme.

\usepackage{eforms}
\makeatletter
    \def\eq@SigField{%
        \centerWidget\eq@rectH%
        \if\autoCenter n\eqcenterWidget=0pt\fi%
        \leavevmode\hbox{\pdfstartlink user{\common@SigFieldCode}%
                \lower\eqcenterWidget\Bbox{\eq@rectW}{\eq@rectH}\pdfendlink%
        }%
        \endgroup%
    }
\makeatother

\newcommand{\mySigField}[5]{
    \begin{varwidth}{#2}
        \textcolor{\colFeat}{
            \fcolorbox{black!5!white}{black!5!white}{
                \ifthenelse{\equal{#4}{}}%
                    {\ifthenelse{\equal{#5}{}}%
                        {\sigField[\Lock{/Action/Include/Fields [(name#1)(pos#1)]}]{#1}{#2}{#3}}%
                        {\sigField[\Lock{/Action/Include/Fields [(name#1)]}]{#1}{#2}{#3}}%
                    }%  
                    {\ifthenelse{\equal{#5}{}}%
                        {\sigField[\Lock{/Action/Include/Fields [(pos#1)]}]{#1}{#2}{#3}}%
                        {\sigField{#1}{#2}{#3}}%
                    }%
                }\\[1mm]            
            \rule{#2+3mm}{2pt}\\[2mm]
            \begin{tabular}{rl}
                \raggedleft Name: & \ifthenelse{\equal{#4}{}}{\TextField[name=name#1,width=6cm]{}}{#4}\\\\[-3mm]
                \raggedleft Position: & \ifthenelse{\equal{#5}{}}{\TextField[name=pos#1,width=6cm]{}} {#5}
            \end{tabular}
        }
    \end{varwidth}
}


\begin{document}

\section{Example of No Related Fields}
\mySigField{}{\WS}{\HS}{John Smith}{Garbo}

\end{document}

My goal is to make it work as in the picture below:

enter image description here

Can someone provide some insight on how can I get to work.

Thank you very much for your help.

  • 1
    Where can we find the eformspackage? – user31729 Jan 5 '19 at 11:51
  • Your code doesn't define \WS and \HS. And what is your problem? What do mean by xcolor not working? – Ulrike Fischer Jan 5 '19 at 17:45
  • @ChristianHupfer eforms is part of acrotex. You can find it in miktex or on ctan. – Ulrike Fischer Jan 5 '19 at 17:45
  • @UlrikeFischer: Ah, D.P Story's bundle ... – user31729 Jan 5 '19 at 18:03
  • Why don't run the code too see what am talking about? – user3780018 Jan 5 '19 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.