3

I am generating PDF documents using pdflatex with signature images which are pre-converted with Inkscape to pdf.

The current template looks like this ({{ tags }} are django template tags):

\noindent \begin{tabular}{l l l}
CUSTOMER: &   \includegraphics[width=6cm,height=1.5cm,keepaspectratio]{{ customer_sig2 }} & Date: {% now "SHORT_DATE_FORMAT" %}\\
                         & {{ qb_full_name|upper }}      & \\
REP:          & \includegraphics[width=6cm,height=1.5cm,keepaspectratio]{{ rep_sig2 }}  & Date:  {% now "SHORT_DATE_FORMAT" %}\\
                         & {{ qb_rep_name|upper }}
\end{tabular}

Below is rough example of what I currently have and what I need (link):

http://i.stack.imgur.com/v1G30.gif

The signature images are created as PDF with Inkscape from svg base64 data. It seems Inkscape automatically crops to nearest edges. Thats called from python without many options - x = Popen(['/usr/bin/inkscape', tmpfile.name, '--export-pdf=%s' % pdf.name])

How can I best recreate the example image in latex?

EDIT:

Current signatures after help from Przemyslaw, using the following code (showing bottom and left and right margins of page):

\noindent \begin{tabular}{lc}
CUSTOMER: & \includegraphics[height=1.35cm,width=6.1cm,keepaspectratio]{{ customer_sig2 }}\\
\cline{2-2}
 & \multicolumn{1}{r}{\rule{0mm}{4mm} Date: {% now "SHORT_DATE_FORMAT" %} }
 \end{tabular}
 \hfill \begin{tabular}{lr}
 REP: & \includegraphics[height=1.35cm,width=6.5cm,keepaspectratio]{{ rep_sig2 }}\\
\cline{2-2}
& \multicolumn{1}{r}{\rule{0mm}{4mm} Date: {% now "SHORT_DATE_FORMAT" %} }
\end{tabular}

SignaturesAfterEdit

FYI - I'm using jSignature plugin to capture the signature.. THe standard box dimension is 378x95px Example of signature being pushed down by height of image (this would have been a fixed width with keep aspect ratio, no fixed height specified, see hrule for rep signature is nudged down a bit):

SignaturePushedDown

  • Note that you can convert the SVG to TikZ/PGF with InkScape, which might be easier to handle than the PDF. – Martin Schröder May 28 '13 at 9:26
3

A quick solution, with pictures changed:

\documentclass{article}

\usepackage[draft]{graphicx}
\usepackage{url}

\begin{document}

\noindent \begin{tabular}{l l l}
CUSTOMER: &   \includegraphics[width=6cm,height=1.5cm,keepaspectratio]{at} & Date: \\%{% now "SHORT_DATE_FORMAT" %}\\
                         & {\url{ qb_full_name|upper }}      & \\
\end{tabular}
\begin{tabular}{l l l}
REP:          & \includegraphics[width=6cm,height=1.5cm,keepaspectratio]{at}  & Date:  \\%{% now "SHORT_DATE_FORMAT" %}\\
                         & {\url{ qb_rep_name|upper }}
\end{tabular}


\bigskip
Second version:
\bigskip

\noindent \begin{tabular}{lc}
CUSTOMER: &   \includegraphics[width=5cm,height=1.5cm]{at}\\
\cline{2-2}
 & \multicolumn{1}{r}{ Date: 05/23/2013}
\end{tabular}
\hspace{1mm}
\begin{tabular}{l c}
REP:          & \includegraphics[width=6cm,height=1.5cm]{at}\\
\cline{2-2}
  & \multicolumn{1}{r}{\rule{0mm}{4mm} Date: 05/23/2013}
\end{tabular}


\end{document}

Two tables in one line. Package url for underline char. Frame around at.png is a picture. I have removed keepaspectratio to show the begaviour of Date: 05/23/2013, one of them with correction of depth.

enter image description here

  • I'm not sure if this is what I was looking for; I want to insert a bottom border for each image. I can't tell if your image had a border around it already, and the url part in your tex script is wrapping the names... which I would think would place lines under the text, not the signature. – kevins May 24 '13 at 3:22
  • @vonseel What about a second version? – Przemysław Scherwentke May 24 '13 at 4:53
  • Much better. I kept keep aspect ratio and removed the width argument, because varying widths seemed to push one of the tables down a bit since the image aspect ratios vary. I don't want to skew the aspect ratio though. Is there anyway to set the fixed width and preserve aspect ratio, (signatures will have varying height), and not push the table down? Maybe having a 2 column page-width table where the contents of each are aligned to the bottom (pushing both dates to the bottom of a row)? – kevins May 24 '13 at 5:14
  • @vonseel Putting here (dummy) signatures could help us. They are probably enclosed in some maximal rectangular, which should be preserved. – Przemysław Scherwentke May 24 '13 at 6:11
  • You're right, I didn't think of that. I added more information in the original post. The box dimensions are 378px wide, 95px tall, by default -- BUT -- I'm not sure if it comes out of Inkscape with the same aspect ratio, or it trims to the edge of the lines – kevins May 24 '13 at 6:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.