LaTeX QR Based Business Card

6 Comments

I recently found this blog which shows a business card with a QR card. I thought I'd create a business card with LaTeX with a similar QR code. I took a LaTeX template from here, found out about the pst-barcode pacakge, learnt the MECARD format, and combined them to make this:

My QR Business Card
My QR Business Card

I doubt I'll print this card, but just in case you want to make a similar one, here is the LaTeX source:

\documentclass[11pt,a4paper]{memoir}

\setstocksize{55mm}{85mm} % UK Stock size
\setpagecc{55mm}{85mm}{*}
\settypeblocksize{45mm}{75mm}{*}
\setulmargins{5mm}{*}{*}
\setlrmargins{5mm}{*}{*}

\setheadfoot{0.1pt}{0.1pt}
\setheaderspaces{1pt}{*}{*}
\checkandfixthelayout[fixed]

\pagestyle{empty}

\usepackage{pstricks}
\usepackage{pst-barcode}

\begin{document}
%\pagecolor[cmyk]{.22,.36,.51,.08}%
\begin{Spacing}{0.75}%
\noindent
\textbf{Andrew~Brampton~Ph.D.}\\
\rule{75mm}{1mm}\\
\begin{minipage}[t]{30mm}
\vspace{-1mm}%
\begin{pspicture}(30mm,30mm)
% The MECARD format is used to exchange contact information. More information at:
% http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/addressbook/index.html
\psbarcode{MECARD:N:Brampton,Andrew;EMAIL:a.bramptonATlancs.ac.uk;URL:http://bramp.net;;}{eclevel=L width=1.181 height=1.181}{qrcode}
\end{pspicture}
\end{minipage}
\hspace{1mm}
\begin{minipage}[t]{42mm}
\vspace{-1mm}%
\begin{flushright}
{\scriptsize
\begin{Spacing}{1.5}%
% \textbf{Research Associate}\\
\textbf{Network Researcher}\\
Computing Department\\
Lancaster University\vspace{9mm}\\
\end{Spacing}
}
{\tiny
\textbf{email:} a.brampton AT lancs.ac.uk\\
\textbf{web:} http://bramp.net/\\
\vspace*{2mm}
}
\end{flushright}
\end{minipage}
\rule{75mm}{1mm}
\end{Spacing}
\end{document}

Mark

Hello Andrew,

Thank you very much for posting this very interesting article. I have tried your code on my Mac in TeX Live 2009 and found that the following line needs to be changed if using pdflatex:

\usepackage{pst-barcode}

change to:

\usepackage{auto-pst-pdf,pst-barcode}

I would like to know how you produced your reference output as shown in your blog post since when I run your code on my computer the barcode itself gets anti-aliased and looks slightly smoothed/fuzzy around the edges of all of shapes in the barcode, which I am sure would reduce the readability and therefore success of its use.

I look forward to your thoughts.

Regards,

Mark.

2010-03-29 12:48:49

bramp

Hi Mark,

Thanks for the hint about chaning usepackage.

I don't have a Mac and have never used TeX Live on it. So I don't know why your barcode is anti-alaised. I generated my business card with MiKTeX (on Windows), which should render exactly the same as TeX Live.

I suggest you update all your LaTeX packages, and if this fails refer to the pst-barcode documentation, or email them for more advice. Perhaps try some of their test barcodes to rule out any of the extra TeX in my exampl.e

2010-04-05 21:13:21

Mike Smith

Hi Andrew

This looks really interesting.... I edit a journal which we typeset in Latex and I have been thinking a QRCode for the DOI would be good to place on the front page. I couldnt get your code to work (MikTeX 2.7) even with the modified

\usepackage{auto-pst-pdf,pst-barcode}

line under pdflatex. The packages were downloaded and installed but no QRCode shows up. Looking at the log file I get the following error:

Package auto-pst-pdf Warning:
Creation of bramp-autopp.dvi failed.
This warning occured on input line 124.
Package auto-pst-pdf Warning:
Could not create bramp-pics.pdf. Auxiliary files not deleted.
This warning occured on input line 124.

Looks like it couldn't create the QRCode image for some reason.... I tried running it under LaTeX and then viewing the DVI file. This worked fine, as did the conversion to PS. So I guess something is going wrong with auto-pst-pdf.

Any ideas for the failure at all??

cheers

mike

2010-12-24 20:18:22

Alireza

Thanks for the interesting post, could you please make some comment how can I put a png figure instead of QR, seems its tricky due to I always get errors about its size an location,

secondly, your in my case [AT] doesn't look like @ !! how did you make your @ that handsome !

2011-01-09 12:04:54

Randy Dawson

I did a cut and paste, changed usepackage as above comments, yet get this in Texworks (Miktex2.9).

any ideas gurus, I am a noob.

Package ifplatform Warning:
shell escape is disabled, so I can only detect \ifwindows.

)

! Package auto-pst-pdf Error:
"shell escape" (or "write18") is not enabled:
auto-pst-pdf will not work!

2011-10-03 07:38:10

B. J. Potter

This worked easily for me in Ubuntu Linux with TexLive. The only trick was to use latex and dvipdf to compile instead of doing one shot with pdflatex. After I figured that out and made the PDF, my phone scanned it correctly.

2011-10-03 17:24:36

Warning: The submission system on this blog is flaky at best. Please make a copy of your comment before hitting submit or run the risk of losing it.