bugs fixed

This commit is contained in:
Marc Wäckerlin
2025-11-11 15:11:28 +01:00
parent 65335f7981
commit 29ce75ecf1
22 changed files with 476 additions and 447 deletions
+469 -438
View File
@@ -7,8 +7,8 @@
% option evaluation % option evaluation
\RequirePackage{kvoptions} \RequirePackage{kvoptions}
\SetupKeyvalOptions{ \SetupKeyvalOptions{
family=BCQ, family=BCQ,
prefix=BCQ@ prefix=BCQ@
} }
\DeclareStringOption[89mm]{paperwidth} \DeclareStringOption[89mm]{paperwidth}
\DeclareStringOption[59mm]{paperheight} \DeclareStringOption[59mm]{paperheight}
@@ -28,8 +28,8 @@
\DeclareStringOption[1.0]{bgopacity} % background image opacity (1.0 = 100% visible, 0.0 = invisible), default 1.0 \DeclareStringOption[1.0]{bgopacity} % background image opacity (1.0 = 100% visible, 0.0 = invisible), default 1.0
\DeclareStringOption[1.0]{qrbgopacity} % QR code background opacity (1.0 = white solid, 0.0 = transparent), default 1.0 \DeclareStringOption[1.0]{qrbgopacity} % QR code background opacity (1.0 = white solid, 0.0 = transparent), default 1.0
\DeclareStringOption[de]{lang} \DeclareStringOption[de]{lang}
\DeclareBoolOption[false]{ioscrlf} % use CRLF line endings in vCard (iOS compatibility); default off to avoid pdfTeX issues \DeclareBoolOption[true]{crlf} % use CRLF line endings in vCard (iOS compatibility)
\DeclareBoolOption[true]{address} \DeclareComplementaryOption{nocrlf}{crlf}\DeclareBoolOption[true]{address}
\DeclareComplementaryOption{noaddress}{address} \DeclareComplementaryOption{noaddress}{address}
\DeclareBoolOption[true]{hint} \DeclareBoolOption[true]{hint}
\DeclareComplementaryOption{nohint}{hint} \DeclareComplementaryOption{nohint}{hint}
@@ -94,52 +94,52 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% data registration % data registration
\newcommand\BCQ@datareset{% \newcommand\BCQ@datareset{%
\def\BCQ@data@hide{}% \def\BCQ@data@hide{}%
\def\BCQ@data@logo{}% \def\BCQ@data@logo{}%
\def\BCQ@data@height{}% \def\BCQ@data@height{}%
} }
\define@key{BCQ@data}{hide}[true]{% \define@key{BCQ@data}{hide}[true]{%
\edef\BCQ@data@hide{#1}% \edef\BCQ@data@hide{#1}%
} }
\define@key{BCQ@data}{logo}{% \define@key{BCQ@data}{logo}{%
\def\BCQ@data@logo{#1}% \def\BCQ@data@logo{#1}%
} }
\define@key{BCQ@data}{height}{% \define@key{BCQ@data}{height}{%
\def\BCQ@data@height{#1}% \def\BCQ@data@height{#1}%
} }
\newlength{\BCQ@companybrandingheight} \newlength{\BCQ@companybrandingheight}
\setlength{\BCQ@companybrandingheight}{2em} \setlength{\BCQ@companybrandingheight}{2em}
\newcommand\BCQ@applycompanyoptions{% \newcommand\BCQ@applycompanyoptions{%
\csundef{Xcompanylogo}% \csundef{Xcompanylogo}%
\csundef{Xcompanylogoheight}% \csundef{Xcompanylogoheight}%
\setlength{\BCQ@companybrandingheight}{2em}% \setlength{\BCQ@companybrandingheight}{2em}%
\ifx\BCQ@data@logo\@empty\else \ifx\BCQ@data@logo\@empty\else
\let\Xcompanylogo\BCQ@data@logo \let\Xcompanylogo\BCQ@data@logo
\ifx\BCQ@data@height\@empty \ifx\BCQ@data@height\@empty
\def\Xcompanylogoheight{1.5em}% \def\Xcompanylogoheight{1.5em}%
\else \else
\edef\Xcompanylogoheight{\BCQ@data@height}% \edef\Xcompanylogoheight{\BCQ@data@height}%
\fi \fi
\setlength{\BCQ@companybrandingheight}{\Xcompanylogoheight}% \setlength{\BCQ@companybrandingheight}{\Xcompanylogoheight}%
\fi \fi
} }
\newcommand\registerData[1]{% \newcommand\registerData[1]{%
\expandafter\newcommand\csname #1\endcsname[2][]{% \expandafter\newcommand\csname #1\endcsname[2][]{%
\BCQ@datareset \BCQ@datareset
\edef\BCQ@data@options{##1}% \edef\BCQ@data@options{##1}%
\ifx\BCQ@data@options\@empty\else \ifx\BCQ@data@options\@empty\else
\setkeys{BCQ@data}{##1}% \setkeys{BCQ@data}{##1}%
\fi \fi
\csundef{X#1@hide}% \csundef{X#1@hide}%
\ifx\BCQ@data@hide\@empty\else \ifx\BCQ@data@hide\@empty\else
\edef\BCQ@data@hidetmp{\BCQ@data@hide}% \edef\BCQ@data@hidetmp{\BCQ@data@hide}%
\ifdefstring{\BCQ@data@hidetmp}{false}{}{% \ifdefstring{\BCQ@data@hidetmp}{false}{}{%
\expandafter\def\csname X#1@hide\endcsname{true}% \expandafter\def\csname X#1@hide\endcsname{true}%
}% }%
\fi \fi
\expandafter\def\csname X#1\endcsname{##2}% \expandafter\def\csname X#1\endcsname{##2}%
\ifstrequal{#1}{company}{\BCQ@applycompanyoptions}{}% \ifstrequal{#1}{company}{\BCQ@applycompanyoptions}{}%
}% }%
} }
\registerData{type} \registerData{type}
\registerData{givennames} \registerData{givennames}
@@ -181,71 +181,71 @@
% Override document \title to capture card title (original available via \carddocumenttitle) % Override document \title to capture card title (original available via \carddocumenttitle)
\let\BCQ@documenttitle\title \let\BCQ@documenttitle\title
\renewcommand\title[1]{% \renewcommand\title[1]{%
\def\Xtitle{#1}% \def\Xtitle{#1}%
} }
\newcommand\carddocumenttitle[1]{% \newcommand\carddocumenttitle[1]{%
\BCQ@documenttitle{#1}% \BCQ@documenttitle{#1}%
} }
% Special commands with optional parameters % Special commands with optional parameters
% \logo[height=...]{file} - logo next to name, overrides logoheight option % \logo[height=...]{file} - logo next to name, overrides logoheight option
\define@key{BCQ@logo}{height}{\def\BCQ@logoheight@local{#1}} \define@key{BCQ@logo}{height}{\def\BCQ@logoheight@local{#1}}
\newcommand\logo[2][]{ \newcommand\logo[2][]{
\def\Xlogo{#2} \def\Xlogo{#2}
\def\BCQ@logo@tmp{#1}% \def\BCQ@logo@tmp{#1}%
\ifx\BCQ@logo@tmp\@empty\else \ifx\BCQ@logo@tmp\@empty\else
\setkeys{BCQ@logo}{#1} \setkeys{BCQ@logo}{#1}
\fi \fi
} }
% \qrlogo[scale=...,opacity=...]{file} - logo in QR code center (scale is unitless fraction like 0.3) % \qrlogo[scale=...,opacity=...]{file} - logo in QR code center (scale is unitless fraction like 0.3)
\define@key{BCQ@qrlogo}{scale}{\def\BCQ@qrlogoscale@local{#1}} \define@key{BCQ@qrlogo}{scale}{\def\BCQ@qrlogoscale@local{#1}}
\define@key{BCQ@qrlogo}{opacity}{\def\BCQ@qrbgopacity@local{#1}} \define@key{BCQ@qrlogo}{opacity}{\def\BCQ@qrbgopacity@local{#1}}
\newcommand\qrlogo[2][]{ \newcommand\qrlogo[2][]{
\def\Xqrlogo{#2} \def\Xqrlogo{#2}
\def\BCQ@qrlogo@tmp{#1}% \def\BCQ@qrlogo@tmp{#1}%
\ifx\BCQ@qrlogo@tmp\@empty\else \ifx\BCQ@qrlogo@tmp\@empty\else
\setkeys{BCQ@qrlogo}{#1} \setkeys{BCQ@qrlogo}{#1}
\fi \fi
} }
% \background[scale=...,opacity=...]{file/color} - background image or color % \background[scale=...,opacity=...]{file/color} - background image or color
\define@key{BCQ@background}{scale}{\def\BCQ@bgscale@local{#1}} \define@key{BCQ@background}{scale}{\def\BCQ@bgscale@local{#1}}
\define@key{BCQ@background}{opacity}{\def\BCQ@bgopacity@local{#1}} \define@key{BCQ@background}{opacity}{\def\BCQ@bgopacity@local{#1}}
\newcommand\background[2][]{ \newcommand\background[2][]{
\def\Xbackground{#2} \def\Xbackground{#2}
\def\BCQ@background@tmp{#1}% \def\BCQ@background@tmp{#1}%
\ifx\BCQ@background@tmp\@empty\else \ifx\BCQ@background@tmp\@empty\else
\setkeys{BCQ@background}{#1} \setkeys{BCQ@background}{#1}
\fi \fi
} }
\registerData{companylogo} % content (image/object) to display instead of company text (company still in vCard) \registerData{companylogo} % content (image/object) to display instead of company text (company still in vCard)
\define@key{BCQ@companylogo}{height}{% \define@key{BCQ@companylogo}{height}{%
\def\BCQ@companylogo@height{#1}% \def\BCQ@companylogo@height{#1}%
} }
\renewcommand\companylogo[2][]{% \renewcommand\companylogo[2][]{%
\def\BCQ@companylogo@height{}% \def\BCQ@companylogo@height{}%
\edef\BCQ@companylogo@options{#1}% \edef\BCQ@companylogo@options{#1}%
\ifx\BCQ@companylogo@options\@empty\else \ifx\BCQ@companylogo@options\@empty\else
\setkeys{BCQ@companylogo}{#1}% \setkeys{BCQ@companylogo}{#1}%
\fi \fi
\def\Xcompanylogo{#2}% \def\Xcompanylogo{#2}%
\ifx\BCQ@companylogo@height\@empty \ifx\BCQ@companylogo@height\@empty
\def\Xcompanylogoheight{1.5em}% \def\Xcompanylogoheight{1.5em}%
\else \else
\edef\Xcompanylogoheight{\BCQ@companylogo@height}% \edef\Xcompanylogoheight{\BCQ@companylogo@height}%
\fi \fi
\setlength{\BCQ@companybrandingheight}{\Xcompanylogoheight}% \setlength{\BCQ@companybrandingheight}{\Xcompanylogoheight}%
} }
\newcommand\ifvisible[3]{% \newcommand\ifvisible[3]{%
\ifcsdef{#1}{% \ifcsdef{#1}{%
\ifcsdef{#1@hide}{#3}{#2}% \ifcsdef{#1@hide}{#3}{#2}%
}{#3}% }{#3}%
} }
\newcommand\conddisplay[1]{% \newcommand\conddisplay[1]{%
\ifvisible{#1}{\exec{#1}}{}% \ifvisible{#1}{\exec{#1}}{}%
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -254,11 +254,11 @@
\newcommand\exec[1]{\csname #1\endcsname} \newcommand\exec[1]{\csname #1\endcsname}
\newcommand\insa[3][]{\ifvisible{#2}{ \newcommand\insa[3][]{\ifvisible{#2}{
\ifBCQ@iconleft \ifBCQ@iconleft
\ifBCQ@icon\parbox{1em}{\centering\exec{#3}}\ \fi\ifBCQ@hint{\tiny#1}\fi\ifBCQ@fill\hfill\fi\exec{#2} \ifBCQ@icon\parbox{1em}{\centering\exec{#3}}\ \fi\ifBCQ@hint{\tiny#1}\fi\ifBCQ@fill\hfill\fi\exec{#2}
\else \else
\ifBCQ@hint{\tiny#1\ }\fi\exec{#2}\ifBCQ@fill\hfill\fi\ifBCQ@icon\ \parbox{1em}{\centering\exec{#3}}\fi \ifBCQ@hint{\tiny#1\ }\fi\exec{#2}\ifBCQ@fill\hfill\fi\ifBCQ@icon\ \parbox{1em}{\centering\exec{#3}}\fi
\fi \fi
}{}} }{}}
\newcommand\ifexists[2]{\ifcsdef{#1}{#2}{}} \newcommand\ifexists[2]{\ifcsdef{#1}{#2}{}}
\newcommand\ifboth[3]{\ifcsdef{#1}{\ifcsdef{#2}{#3}{}}{}} \newcommand\ifboth[3]{\ifcsdef{#1}{\ifcsdef{#2}{#3}{}}{}}
@@ -268,13 +268,23 @@
% internal boxes and lengths for measuring % internal boxes and lengths for measuring
\newsavebox{\BCQ@namebox} \newsavebox{\BCQ@namebox}
\newsavebox{\BCQ@logobox} \newsavebox{\BCQ@logobox}
\newsavebox{\BCQ@companytitlebox}
\newsavebox{\BCQ@companyrightbox}
\newlength{\BCQ@logoheightdimen} \newlength{\BCQ@logoheightdimen}
\setlength{\BCQ@logoheightdimen}{0pt}% initialize to prevent errors \setlength{\BCQ@logoheightdimen}{0pt}% initialize to prevent errors
\newlength{\BCQ@bgimagedimen} \newlength{\BCQ@bgimagedimen}
\setlength{\BCQ@bgimagedimen}{0pt} \setlength{\BCQ@bgimagedimen}{0pt}
\newdimen\BCQ@companytitlewidth
\newdimen\BCQ@companyrightwidth
\newdimen\BCQ@companylineavailable
\newdimen\BCQ@companylinesum
\newif\ifBCQ@companylineneeded
\newif\ifBCQ@companytitleexists
\newif\ifBCQ@companyrightexists
\newlength{\BCQ@reservedheight} \newlength{\BCQ@reservedheight}
\newlength{\BCQ@heightscale} \newlength{\BCQ@heightscale}
\newlength{\BCQ@namewidth} \newlength{\BCQ@namewidth}
\newlength{\BCQ@namecolumnwidth}
\newlength{\BCQ@logosep} \newlength{\BCQ@logosep}
\newlength{\BCQ@logosepused} \newlength{\BCQ@logosepused}
\setlength{\BCQ@logosep}{1em} \setlength{\BCQ@logosep}{1em}
@@ -282,161 +292,179 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% name - assemble full name from the parts, such as Xgivennames and Xfamilynames % name - assemble full name from the parts, such as Xgivennames and Xfamilynames
\newcommand\personalnamevcard{% \newcommand\personalnamevcard{%
\ifexists{Xhonoricprefix}{\Xhonoricprefix\ }% \ifexists{Xhonoricprefix}{\Xhonoricprefix\ }%
\ifexists{Xgivennames}{\Xgivennames\ }% \ifexists{Xgivennames}{\Xgivennames\ }%
\ifexists{Xadditionalnames}{\Xadditionalnames\ }% \ifexists{Xadditionalnames}{\Xadditionalnames\ }%
\ifexists{Xfamilynames}{\Xfamilynames}% \ifexists{Xfamilynames}{\Xfamilynames}%
\ifexists{Xhonoricsuffix}{\ \Xhonoricsuffix}% \ifexists{Xhonoricsuffix}{\ \Xhonoricsuffix}%
} }
\newcommand\personalname{% \newcommand\personalname{%
\ifvisible{Xhonoricprefix}{\Xhonoricprefix\ }{}% \ifvisible{Xhonoricprefix}{\Xhonoricprefix\ }{}%
\ifvisible{Xgivennames}{\Xgivennames\ }{}% \ifvisible{Xgivennames}{\Xgivennames\ }{}%
\ifvisible{Xadditionalnames}{\Xadditionalnames\ }{}% \ifvisible{Xadditionalnames}{\Xadditionalnames\ }{}%
\ifvisible{Xfamilynames}{\Xfamilynames}{}% \ifvisible{Xfamilynames}{\Xfamilynames}{}%
\ifvisible{Xhonoricsuffix}{\ \Xhonoricsuffix}{}% \ifvisible{Xhonoricsuffix}{\ \Xhonoricsuffix}{}%
} }
\newcommand\ifhaspersonalname[2]{% \newcommand\ifhaspersonalname[2]{%
\ifvisible{Xhonoricprefix}{#1}{% \ifvisible{Xhonoricprefix}{#1}{%
\ifvisible{Xgivennames}{#1}{% \ifvisible{Xgivennames}{#1}{%
\ifvisible{Xadditionalnames}{#1}{% \ifvisible{Xadditionalnames}{#1}{%
\ifvisible{Xfamilynames}{#1}{% \ifvisible{Xfamilynames}{#1}{%
\ifvisible{Xhonoricsuffix}{#1}{#2}% \ifvisible{Xhonoricsuffix}{#1}{#2}%
}% }%
}% }%
}% }%
}% }%
} }
\newcommand\ifhaspositiontext[2]{% \newcommand\ifhaspositiontext[2]{%
\ifvisible{Xcompany}{#1}{% \ifvisible{Xcompany}{#1}{%
\ifvisible{Xtitle}{#1}{% \ifvisible{Xtitle}{#1}{%
\ifvisible{Xrole}{#1}{#2}% \ifvisible{Xrole}{#1}{#2}%
}% }%
}% }%
} }
\newcommand\ifhaspositionblock[2]{% \newcommand\ifhaspositionblock[2]{%
\ifhaspositiontext{#1}{% \ifhaspositiontext{#1}{%
\ifcsdef{Xcompanylogo}{#1}{#2}% \ifcsdef{Xcompanylogo}{#1}{#2}%
}% }%
} }
\newcommand\ifhaspersonalnamevcard[2]{% \newcommand\ifhaspersonalnamevcard[2]{%
\ifcsname Xhonoricprefix\endcsname \ifcsname Xhonoricprefix\endcsname
#1% #1%
\else\ifcsname Xgivennames\endcsname \else\ifcsname Xgivennames\endcsname
#1% #1%
\else\ifcsname Xadditionalnames\endcsname \else\ifcsname Xadditionalnames\endcsname
#1% #1%
\else\ifcsname Xfamilynames\endcsname \else\ifcsname Xfamilynames\endcsname
#1% #1%
\else\ifcsname Xhonoricsuffix\endcsname \else\ifcsname Xhonoricsuffix\endcsname
#1% #1%
\else \else
#2% #2%
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
} }
% heightscale - calculate available height for text/QR % heightscale - calculate available height for text/QR
% Uses actual logo height if logo is taller than default reserved space % Uses actual logo height if logo is taller than default reserved space
% This is computed as a length and stored, not a macro % This is computed as a length and stored, not a macro
\newcommand\computeheightscale{% \newcommand\computeheightscale{%
\setlength{\BCQ@reservedheight}{\dimexpr\ifhaspersonalname{2em}{0em}+\ifhaspositionblock{\BCQ@companybrandingheight}{0pt}\relax}% \setlength{\BCQ@reservedheight}{\dimexpr\ifhaspersonalname{2em}{0em}+\ifhaspositionblock{\BCQ@companybrandingheight}{0pt}\relax}%
\ifdim\BCQ@logoheightdimen>\BCQ@reservedheight \ifdim\BCQ@logoheightdimen>\BCQ@reservedheight
\setlength{\BCQ@heightscale}{\dimexpr\textheight-\BCQ@logoheightdimen-\ifcsdef{Xpgpfingerprint}{2em}{0em}\relax}% \setlength{\BCQ@heightscale}{\dimexpr\textheight-\BCQ@logoheightdimen-\ifcsdef{Xpgpfingerprint}{2em}{0em}\relax}%
\else \else
\setlength{\BCQ@heightscale}{\dimexpr\textheight-\BCQ@reservedheight-\ifcsdef{Xpgpfingerprint}{2em}{0em}\relax}% \setlength{\BCQ@heightscale}{\dimexpr\textheight-\BCQ@reservedheight-\ifcsdef{Xpgpfingerprint}{2em}{0em}\relax}%
\fi \fi
} }
\newcommand\heightscale{\BCQ@heightscale} \newcommand\heightscale{\BCQ@heightscale}
\newcommand\companyrolestringdisplay{% \newcommand\companytitleblock{%
\ifvisible{Xtitle}{\Xtitle}{}% \ifvisible{Xtitle}{\Xtitle}{}%
\ifvisible{Xrole}{% \ifvisible{Xrole}{%
\ifvisible{Xtitle}{, }{}% \ifvisible{Xtitle}{,\ }{}%
\Xrole \Xrole
}{}% }{}%
\ifvisible{Xcompany}{% }
\ifvisible{Xtitle}{\ \Xcompany}{% \newcommand\companyrightblock{%
\ifvisible{Xrole}{\ \Xcompany}{\Xcompany}% \ifcsdef{Xcompanylogo}{\companylogocontent}{}%
}% \ifvisible{Xcompany}{%
}{}% \Xcompany
\ifcsdef{Xcompanylogo}{\hspace{0.5em}}{}%
}{}%
} }
\newcommand\companybrandingline{% \newcommand\companybrandingline{%
\ifcsdef{Xcompanylogo}{\companylogocontent}{}% \begingroup
\ifhaspositiontext{% \BCQ@companytitleexistsfalse
\ifcsdef{Xcompanylogo}{\hspace{0.5em}}{}% \ifvisible{Xtitle}{\BCQ@companytitleexiststrue}{}%
\companyrolestringdisplay \ifvisible{Xrole}{\BCQ@companytitleexiststrue}{}%
}{}% \BCQ@companyrightexistsfalse
\ifvisible{Xcompany}{\BCQ@companyrightexiststrue}{}%
\ifcsdef{Xcompanylogo}{\BCQ@companyrightexiststrue}{}%
\ifBCQ@companytitleexists
\companytitleblock
\fi
\ifBCQ@companytitleexists
\ifBCQ@companyrightexists
\space
\fi
\fi
\ifBCQ@companyrightexists
\companyrightblock
\fi
\endgroup
} }
\newcommand\companyrolestringvcard{% \newcommand\companyrolestringvcard{%
\ifcsname Xtitle\endcsname \ifcsname Xtitle\endcsname
\Xtitle \Xtitle
\fi \fi
\ifcsname Xrole\endcsname \ifcsname Xrole\endcsname
\ifcsname Xtitle\endcsname , \fi \ifcsname Xtitle\endcsname ,\ \fi
\Xrole \Xrole
\fi \fi
\ifcsname Xcompany\endcsname \ifcsname Xcompany\endcsname
\ifcsname Xtitle\endcsname \ifcsname Xtitle\endcsname
\ \Xcompany \ \Xcompany
\else \else
\ifcsname Xrole\endcsname \ifcsname Xrole\endcsname
\ \Xcompany \ \Xcompany
\else \else
\Xcompany \Xcompany
\fi \fi
\fi \fi
\fi \fi
} }
\newcommand\displayname{% \newcommand\displayname{%
\ifhaspersonalname{\personalname}{\companybrandingline}% \ifhaspersonalname{\personalname}{\companybrandingline}%
} }
\newcommand\BCQ@appendvcardposition{% \newcommand\BCQ@appendvcardposition{%
\ifhaspersonalnamevcard{% \ifhaspersonalnamevcard{%
\ (\companyrolestringvcard)% \ (\companyrolestringvcard)%
}{% }{%
\companyrolestringvcard \companyrolestringvcard
}% }%
} }
\newcommand\BCQ@buildname{% \newcommand\BCQ@buildname{%
\ifhaspersonalnamevcard{% \ifhaspersonalnamevcard{%
\personalnamevcard \personalnamevcard
\ifcsname Xtitle\endcsname \ifcsname Xtitle\endcsname
\BCQ@appendvcardposition \BCQ@appendvcardposition
\else \else
\ifcsname Xrole\endcsname \ifcsname Xrole\endcsname
\BCQ@appendvcardposition \BCQ@appendvcardposition
\else \else
\ifcsname Xcompany\endcsname \ifcsname Xcompany\endcsname
\BCQ@appendvcardposition \BCQ@appendvcardposition
\fi \fi
\fi \fi
\fi \fi
}{% }{%
\companyrolestringvcard \companyrolestringvcard
}% }%
} }
\let\BCQ@cachedname\@empty \let\BCQ@cachedname\@empty
\newcommand\BCQ@setnamecache{% \newcommand\BCQ@setnamecache{%
\begingroup \begingroup
\edef\BCQ@tmp{\BCQ@buildname}% \edef\BCQ@tmp{\BCQ@buildname}%
\global\let\BCQ@cachedname\BCQ@tmp \global\let\BCQ@cachedname\BCQ@tmp
\endgroup \endgroup
} }
\newcommand\name{% \newcommand\name{%
\ifx\BCQ@cachedname\@empty \ifx\BCQ@cachedname\@empty
\BCQ@buildname \BCQ@buildname
\else \else
\BCQ@cachedname \BCQ@cachedname
\fi \fi
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% vcard - the content of the vcard % vcard - the content of the vcard
% newline selection: default LF (robust for qrcode). Optional CRLF if ioscrlf option set. % newline selection: default LF (robust for qrcode). Optional CRLF if crlf option set.
\ifBCQ@ioscrlf {\catcode`\^^M=12\gdef\BCQ@carriagereturn{^^M}}% literal CR (catcode 12)
\def\BCQ@nl{\char13\char10}% CRLF {\catcode`\^^J=12\gdef\BCQ@linefeed{^^J}}% literal LF (catcode 12)
\ifBCQ@crlf
\def\BCQ@nl{\BCQ@carriagereturn\BCQ@linefeed}% CRLF
\else \else
\def\BCQ@nl{^^J}% LF only \def\BCQ@nl{\BCQ@linefeed}% LF only
\fi \fi
% vcard assembly (version 4.0 retained). CRLF improves iOS import robustness. % vcard assembly (version 4.0 retained). CRLF improves iOS import robustness.
\newcommand\vcard{BEGIN:VCARD\BCQ@nl \newcommand\vcard{BEGIN:VCARD\BCQ@nl
@@ -474,59 +502,59 @@ END:VCARD\BCQ@nl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% formatcountry - format country based on length and options % formatcountry - format country based on length and options
\newcommand\formatcountry{% \newcommand\formatcountry{%
\ifcsdef{Xcountry}{% \ifcsdef{Xcountry}{%
\ifvisible{Xcountry}{% \ifvisible{Xcountry}{%
\def\BCQ@shouldinline{false}% \def\BCQ@shouldinline{false}%
\def\BCQ@haszipcity{false}% \def\BCQ@haszipcity{false}%
\ifvisible{Xcity}{\def\BCQ@haszipcity{true}}{}% \ifvisible{Xcity}{\def\BCQ@haszipcity{true}}{}%
\ifvisible{Xzip}{\def\BCQ@haszipcity{true}}{}% \ifvisible{Xzip}{\def\BCQ@haszipcity{true}}{}%
% Check countryformat option % Check countryformat option
\ifdefstring{\BCQ@countryformat}{inline}{% \ifdefstring{\BCQ@countryformat}{inline}{%
\def\BCQ@shouldinline{true}% \def\BCQ@shouldinline{true}%
}{% }{%
\ifdefstring{\BCQ@countryformat}{below}{% \ifdefstring{\BCQ@countryformat}{below}{%
\def\BCQ@shouldinline{false}% \def\BCQ@shouldinline{false}%
}{% }{%
% auto mode: check length % auto mode: check length
\StrLen{\Xcountry}[\BCQ@countrylen]% \StrLen{\Xcountry}[\BCQ@countrylen]%
\ifnum\BCQ@countrylen<4\relax% \ifnum\BCQ@countrylen<4\relax%
% Short country code AND city/zip exists inline % Short country code AND city/zip exists inline
\ifdefstring{\BCQ@haszipcity}{true}{% \ifdefstring{\BCQ@haszipcity}{true}{%
\def\BCQ@shouldinline{true}% \def\BCQ@shouldinline{true}%
}{}% }{}%
\fi% \fi%
}% }%
}% }%
% Output country % Output country
\ifdefstring{\BCQ@shouldinline}{true}{% \ifdefstring{\BCQ@shouldinline}{true}{%
\Xcountry\ \textemdash\ \conddisplay{Xzip} \conddisplay{Xcity}% \Xcountry\ \textemdash\ \conddisplay{Xzip} \conddisplay{Xcity}%
}{% }{%
\conddisplay{Xzip} \conddisplay{Xcity} \conddisplay{Xzip} \conddisplay{Xcity}
\Xcountry \Xcountry
}% }%
}{% }{%
\conddisplay{Xzip} \conddisplay{Xcity}% \conddisplay{Xzip} \conddisplay{Xcity}%
}% }%
}{ }{
\conddisplay{Xzip} \conddisplay{Xcity}% \conddisplay{Xzip} \conddisplay{Xcity}%
}% }%
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% address - the address as shown in the textbox % address - the address as shown in the textbox
\newcommand\address{ \newcommand\address{
\conddisplay{Xpobox} \conddisplay{Xpobox}
\conddisplay{Xextaddr} \conddisplay{Xextaddr}
\conddisplay{Xstreet} \conddisplay{Xstreet}
\formatcountry \formatcountry
\conddisplay{Xregion} \conddisplay{Xregion}
} }
@@ -534,35 +562,35 @@ END:VCARD\BCQ@nl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% inserttext - assemble the textbox % inserttext - assemble the textbox
\newcommand\inserttext{ \newcommand\inserttext{
%\frame %\frame
{ {
\begin{minipage}[c][\heightscale][c]{\textpercents\textwidth} \begin{minipage}[c][\heightscale][c]{\textpercents\textwidth}
\ifBCQ@rightalign\begin{flushright}\fi \ifBCQ@rightalign\begin{flushright}\fi
\ifexists{printaddress}{ \ifexists{printaddress}{
\ifBCQ@iconleft \ifBCQ@iconleft
\ifBCQ@icon\parbox[c]{1em}{\faMapMarker}\ \ifBCQ@fill\hfill\fi\fi \ifBCQ@icon\parbox[c]{1em}{\faMapMarker}\ \ifBCQ@fill\hfill\fi\fi
%\frame{ %\frame{
%\pbox[t]{\dimexpr\textwidth-2em\relax}{ %\pbox[t]{\dimexpr\textwidth-2em\relax}{
\begin{varwidth}{\dimexpr\textwidth-2em\relax} \begin{varwidth}{\dimexpr\textwidth-2em\relax}
\ifBCQ@rightalign\enforceright\fi\address \ifBCQ@rightalign\enforceright\fi\address
\end{varwidth} \end{varwidth}
%} %}
%} %}
\else \else
%\pbox[t]{\dimexpr\textwidth-2em\relax}{ %\pbox[t]{\dimexpr\textwidth-2em\relax}{
\begin{varwidth}{\dimexpr\textwidth-2em\relax} \begin{varwidth}{\dimexpr\textwidth-2em\relax}
\ifBCQ@rightalign\enforceright\fi\address \ifBCQ@rightalign\enforceright\fi\address
\end{varwidth} \end{varwidth}
%} %}
\ifBCQ@icon\ifBCQ@fill\hfill\fi\ \parbox[c]{1em}{\faMapMarker}\fi \ifBCQ@icon\ifBCQ@fill\hfill\fi\ \parbox[c]{1em}{\faMapMarker}\fi
\fi \fi
\vspace{1em} \vspace{1em}
} }
\insa[tel:]{Xphone}{faMobile}\insa[mailto:]{Xemail}{Email}\insa[xmpp]{Xjabber}{faCommentsO}\insa[matrix.org]{Xmatrixorg}{faCommentsO}\insa[nextcloud-id]{Xcloud}{faCloud}\insa[\protdisplay]{Xhomepage}{faHome}\insa[\protdisplay]{Xwordpress}{faWordpress}\insa[\protdisplay]{Xdrupal}{faDrupal}\insa[\protdisplay]{Xjoomla}{faJoomla}\insa[{\protprefix}\lang.wikipedia.org/wiki/]{Xwikipedia}{faWikipediaW}\insa[\protdisplay]{Xlink}{faLink}\insa[\protdisplay]{Xworld}{faGlobe}\insa[\protdisplay]{Xgit}{faGit}\insa[\protdisplay]{Xgitea}{faGithubAlt}\insa[{\protprefix}github.com/]{Xgithub}{faGithub}\insa[{\protprefix}facebook.com/]{Xfacebook}{faFacebook}\insa[{\protprefix}twitter.com/]{Xtwitter}{faTwitter}\insa[{\protprefix}youtube.com/user/]{Xyoutube}{faYoutube}\insa[{\protprefix}plus.google.com/+]{Xgoogle}{faGooglePlus} \insa[tel:]{Xphone}{faMobile}\insa[mailto:]{Xemail}{Email}\insa[xmpp]{Xjabber}{faCommentsO}\insa[matrix.org]{Xmatrixorg}{faCommentsO}\insa[nextcloud-id]{Xcloud}{faCloud}\insa[\protdisplay]{Xhomepage}{faHome}\insa[\protdisplay]{Xwordpress}{faWordpress}\insa[\protdisplay]{Xdrupal}{faDrupal}\insa[\protdisplay]{Xjoomla}{faJoomla}\insa[{\protprefix}\lang.wikipedia.org/wiki/]{Xwikipedia}{faWikipediaW}\insa[\protdisplay]{Xlink}{faLink}\insa[\protdisplay]{Xworld}{faGlobe}\insa[\protdisplay]{Xgit}{faGit}\insa[\protdisplay]{Xgitea}{faGithubAlt}\insa[{\protprefix}github.com/]{Xgithub}{faGithub}\insa[{\protprefix}facebook.com/]{Xfacebook}{faFacebook}\insa[{\protprefix}twitter.com/]{Xtwitter}{faTwitter}\insa[{\protprefix}youtube.com/user/]{Xyoutube}{faYoutube}\insa[{\protprefix}plus.google.com/+]{Xgoogle}{faGooglePlus}
\ifBCQ@rightalign\end{flushright}\fi \ifBCQ@rightalign\end{flushright}\fi
\end{minipage} \end{minipage}
} }
} }
@@ -570,42 +598,42 @@ END:VCARD\BCQ@nl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% insertqrcode - insert the qr-code with optional white background % insertqrcode - insert the qr-code with optional white background
\newcommand\insertqrcode{ \newcommand\insertqrcode{
% Use local overrides if specified, otherwise use global options % Use local overrides if specified, otherwise use global options
\ifcsdef{BCQ@qrbgopacity@local}{% \ifcsdef{BCQ@qrbgopacity@local}{%
\edef\BCQ@qrbgopacity@used{\BCQ@qrbgopacity@local}% \edef\BCQ@qrbgopacity@used{\BCQ@qrbgopacity@local}%
}{% }{%
\edef\BCQ@qrbgopacity@used{\BCQ@qrbgopacity}% \edef\BCQ@qrbgopacity@used{\BCQ@qrbgopacity}%
}% }%
\ifcsdef{BCQ@qrlogoscale@local}{% \ifcsdef{BCQ@qrlogoscale@local}{%
\edef\BCQ@qrlogoscale@used{\BCQ@qrlogoscale@local}% \edef\BCQ@qrlogoscale@used{\BCQ@qrlogoscale@local}%
}{% }{%
\edef\BCQ@qrlogoscale@used{\BCQ@qrlogoscale}% \edef\BCQ@qrlogoscale@used{\BCQ@qrlogoscale}%
}% }%
%\frame %\frame
{ {
\begin{minipage}[c][\heightscale][c]{\imagepercents\textwidth} \begin{minipage}[c][\heightscale][c]{\imagepercents\textwidth}
\begin{tikzpicture} \begin{tikzpicture}
% White background behind QR code (for readability over background images) % White background behind QR code (for readability over background images)
\node[fill=white, opacity=\BCQ@qrbgopacity@used, inner sep=0pt, outer sep=2mm, minimum size=\textwidth] (bg) at (0,0) {}; \node[fill=white, opacity=\BCQ@qrbgopacity@used, inner sep=0pt, outer sep=2mm, minimum size=\textwidth] (bg) at (0,0) {};
% QR code on top % QR code on top
\node[inner sep=0pt, outer sep=0pt] (qr) at (0,0) {% \node[inner sep=0pt, outer sep=0pt] (qr) at (0,0) {%
% QR code with optional qrlogo overlay in center % QR code with optional qrlogo overlay in center
\ifcsdef{Xqrlogo}{% \ifcsdef{Xqrlogo}{%
\begin{tikzpicture} \begin{tikzpicture}
\node[inner sep=0pt] (qr2) {\qrcode[level=\BCQ@qreclevel,version=0,height=\textwidth]{\vcard}}; \node[inner sep=0pt] (qr2) {\qrcode[level=\BCQ@qreclevel,version=0,height=\textwidth]{\vcard}};
% Logo with transparent background preserved (no fill), padding still applied % Logo with transparent background preserved (no fill), padding still applied
% qrlogoscale/scale is unitless fraction (0.25 = 25% of QR width) % qrlogoscale/scale is unitless fraction (0.25 = 25% of QR width)
\node[inner sep=\BCQ@qrlogoborder\textwidth] at (qr2.center) {% \node[inner sep=\BCQ@qrlogoborder\textwidth] at (qr2.center) {%
\includegraphics[width=\BCQ@qrlogoscale@used\textwidth]{\Xqrlogo}% \includegraphics[width=\BCQ@qrlogoscale@used\textwidth]{\Xqrlogo}%
}; };
\end{tikzpicture}% \end{tikzpicture}%
}{% }{%
% No qrlogo defined, just show QR code % No qrlogo defined, just show QR code
\qrcode[level=\BCQ@qreclevel,version=0,height=\textwidth]{\vcard}% \qrcode[level=\BCQ@qreclevel,version=0,height=\textwidth]{\vcard}%
}% }%
}; };
\end{tikzpicture} \end{tikzpicture}
\end{minipage} \end{minipage}
} }
} }
@@ -613,120 +641,123 @@ END:VCARD\BCQ@nl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% insertname - insert the name on the top % insertname - insert the name on the top
\newcommand\insertname{ \newcommand\insertname{
% typeset name into box for measurement % typeset name into box for measurement
\sbox{\BCQ@namebox}{\bfseries\cond{displayname}}% \sbox{\BCQ@namebox}{\bfseries\cond{displayname}}%
% Set default logoheight if not specified: 4em with company, 2em without % Set default logoheight if not specified: 4em with company, 2em without
\ifx\BCQ@logoheight\@empty \ifx\BCQ@logoheight\@empty
\ifcsdef{Xcompany}{\def\BCQ@logoheight{4em}}{\def\BCQ@logoheight{2em}}% \ifcsdef{Xcompany}{\def\BCQ@logoheight{4em}}{\def\BCQ@logoheight{2em}}%
\fi \fi
% Use local height override if specified, otherwise use global logoheight % Use local height override if specified, otherwise use global logoheight
\ifcsdef{BCQ@logoheight@local}{% \ifcsdef{BCQ@logoheight@local}{%
\edef\BCQ@logoheight@used{\BCQ@logoheight@local}% \edef\BCQ@logoheight@used{\BCQ@logoheight@local}%
}{% }{%
\edef\BCQ@logoheight@used{\BCQ@logoheight}% \edef\BCQ@logoheight@used{\BCQ@logoheight}%
}% }%
% Store logo height as dimension for heightscale calculation % Store logo height as dimension for heightscale calculation
\ifcsdef{Xlogo}{% \ifcsdef{Xlogo}{%
\sbox{\BCQ@logobox}{\includegraphics[height=\BCQ@logoheight@used]{\Xlogo}}% \sbox{\BCQ@logobox}{\includegraphics[height=\BCQ@logoheight@used]{\Xlogo}}%
\setlength{\BCQ@logoheightdimen}{\BCQ@logoheight@used}% \setlength{\BCQ@logoheightdimen}{\BCQ@logoheight@used}%
}{% \setlength{\BCQ@namecolumnwidth}{\dimexpr\textwidth-\wd\BCQ@logobox-\BCQ@logosep\relax}%
\setlength{\BCQ@logoheightdimen}{0pt}% }{%
}% \setlength{\BCQ@logoheightdimen}{0pt}%
% Compute heightscale after logo height is known \setlength{\BCQ@namecolumnwidth}{\textwidth}%
\computeheightscale }%
\ifcsdef{Xlogo}{% logo defined % Compute heightscale after logo height is known
% Logo next to name: dynamic columns (logo natural width, name uses remaining space) \computeheightscale
\setlength{\BCQ@logosepused}{\BCQ@logosep}% \ifcsdef{Xlogo}{% logo defined
\setlength{\BCQ@namewidth}{\dimexpr\textwidth-\wd\BCQ@logobox-\BCQ@logosepused\relax}% % Logo next to name: dynamic columns (logo natural width, name uses remaining space)
\ifdim\BCQ@namewidth<0pt \setlength{\BCQ@logosepused}{\BCQ@logosep}%
\setlength{\BCQ@logosepused}{0pt}% \setlength{\BCQ@namewidth}{\dimexpr\textwidth-\wd\BCQ@logobox-\BCQ@logosepused\relax}%
\setlength{\BCQ@namewidth}{\dimexpr\textwidth-\wd\BCQ@logobox\relax}% \ifdim\BCQ@namewidth<0pt
\ifdim\BCQ@namewidth<0pt\setlength{\BCQ@namewidth}{0pt}\fi \setlength{\BCQ@logosepused}{0pt}%
\fi \setlength{\BCQ@namewidth}{\dimexpr\textwidth-\wd\BCQ@logobox\relax}%
\begin{minipage}{\textwidth} \ifdim\BCQ@namewidth<0pt\setlength{\BCQ@namewidth}{0pt}\fi
\begin{minipage}[c]{\wd\BCQ@logobox}% logo column \fi
\usebox{\BCQ@logobox}% \setlength{\BCQ@namecolumnwidth}{\BCQ@namewidth}%
\end{minipage} \begin{minipage}{\textwidth}
\hspace{\BCQ@logosepused} \begin{minipage}[c]{\wd\BCQ@logobox}% logo column
\begin{minipage}[c]{\BCQ@namewidth}% name column \usebox{\BCQ@logobox}%
\ifBCQ@rightalign\raggedleft\fi% apply alignment \end{minipage}
{\bfseries\cond{displayname}}% \hspace{\BCQ@logosepused}
\ifhaspersonalname{% \begin{minipage}[c]{\BCQ@namewidth}% name column
\ifhaspositionblock{\\\companybrandingline}{}% \ifBCQ@rightalign\raggedleft\fi% apply alignment
}{}% {\bfseries\cond{displayname}}%
\end{minipage} \ifhaspersonalname{%
\end{minipage} \ifhaspositionblock{\\\companybrandingline}{}%
}{% no logo: just name }{}%
{\bfseries\cond{displayname}}% \end{minipage}
\ifhaspersonalname{% \end{minipage}
\ifhaspositionblock{\\\companybrandingline}{}% }{% no logo: just name
}{}% {\bfseries\cond{displayname}}%
} \ifhaspersonalname{%
\ifhaspositionblock{\\\companybrandingline}{}%
}{}%
}
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% drawcardcontent - assemble all blocks (name, text, qr, pgp) % drawcardcontent - assemble all blocks (name, text, qr, pgp)
\newcommand\drawcardcontent{ \newcommand\drawcardcontent{
\BCQ@setnamecache \BCQ@setnamecache
\ifBCQ@rightalign\begin{flushright}\fi \ifBCQ@rightalign\begin{flushright}\fi
\insertname \insertname
\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}} % horizontal line \noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}} % horizontal line
\vfill \vfill
\ifBCQ@qrfirst \ifBCQ@qrfirst
\insertqrcode \insertqrcode
\hfill \hfill
\inserttext \inserttext
\else \else
\inserttext \inserttext
\hfill \hfill
\insertqrcode \insertqrcode
\fi \fi
\ifexists{Xpgpfingerprint}{ \ifexists{Xpgpfingerprint}{
\vfill \vfill
\ifBCQ@iconleft \ifBCQ@iconleft
\faLock\ifBCQ@hint{\tiny\ pgp}\fi\hfill{\small\Xpgpfingerprint} \faLock\ifBCQ@hint{\tiny\ pgp}\fi\hfill{\small\Xpgpfingerprint}
\else \else
{\small\Xpgpfingerprint}\hfill\ifBCQ@hint{\tiny{pgp\ }}\fi\faLock {\small\Xpgpfingerprint}\hfill\ifBCQ@hint{\tiny{pgp\ }}\fi\faLock
\fi \fi
} }
\ifBCQ@rightalign\end{flushright}\fi \ifBCQ@rightalign\end{flushright}\fi
} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% drawcard - main card with optional background % drawcard - main card with optional background
\newcommand\drawcard{ \newcommand\drawcard{
% Use local overrides if specified, otherwise use global options % Use local overrides if specified, otherwise use global options
\ifcsdef{BCQ@bgscale@local}{% \ifcsdef{BCQ@bgscale@local}{%
\edef\BCQ@bgscale@used{\BCQ@bgscale@local}% \edef\BCQ@bgscale@used{\BCQ@bgscale@local}%
}{% }{%
\edef\BCQ@bgscale@used{\BCQ@bgscale}% \edef\BCQ@bgscale@used{\BCQ@bgscale}%
}% }%
\ifcsdef{BCQ@bgopacity@local}{% \ifcsdef{BCQ@bgopacity@local}{%
\edef\BCQ@bgopacity@used{\BCQ@bgopacity@local}% \edef\BCQ@bgopacity@used{\BCQ@bgopacity@local}%
}{% }{%
\edef\BCQ@bgopacity@used{\BCQ@bgopacity}% \edef\BCQ@bgopacity@used{\BCQ@bgopacity}%
}% }%
% Handle background % Handle background
\ifcsdef{Xbackground}{% \ifcsdef{Xbackground}{%
\IfFileExists{\Xbackground}{% \IfFileExists{\Xbackground}{%
% It's an image file: add to background using eso-pic (no layout impact) % It's an image file: add to background using eso-pic (no layout impact)
\AddToShipoutPictureBG*{% \AddToShipoutPictureBG*{%
\AtPageCenter{% \AtPageCenter{%
\begin{tikzpicture}[overlay] \begin{tikzpicture}[overlay]
\node[inner sep=0pt, opacity=\BCQ@bgopacity@used] at (0,0) {% \node[inner sep=0pt, opacity=\BCQ@bgopacity@used] at (0,0) {%
\setlength{\BCQ@bgimagedimen}{\dimexpr\BCQ@bgscale@used\paperheight\relax}% \setlength{\BCQ@bgimagedimen}{\dimexpr\BCQ@bgscale@used\paperheight\relax}%
\includegraphics[height=\BCQ@bgimagedimen]{\Xbackground}% \includegraphics[height=\BCQ@bgimagedimen]{\Xbackground}%
}; };
\end{tikzpicture}% \end{tikzpicture}%
}% }%
}% }%
}{% }{%
% Not a file: treat as color % Not a file: treat as color
\pagecolor{\Xbackground}% \pagecolor{\Xbackground}%
}% }%
}{}% }{}%
% Draw card content % Draw card content
\drawcardcontent \drawcardcontent
} }
@@ -734,52 +765,52 @@ END:VCARD\BCQ@nl}
% cut / crop marks % cut / crop marks
\RequirePackage[\papersize,noinfo,center,pdftex]{crop} \RequirePackage[\papersize,noinfo,center,pdftex]{crop}
\newcommand\tl{ \newcommand\tl{
\begin{picture}(0,0) \begin{picture}(0,0)
\thinlines\unitlength1mm \thinlines\unitlength1mm
\put(-\border,0){\line(1,0){\cutlen}} \put(-\border,0){\line(1,0){\cutlen}}
\put(0,\border){\line(0,-1){\cutlen}} \put(0,\border){\line(0,-1){\cutlen}}
\end{picture} \end{picture}
} }
\newcommand\tr{ \newcommand\tr{
\begin{picture}(0,0) \begin{picture}(0,0)
\thinlines\unitlength1mm \thinlines\unitlength1mm
\put(\border,0){\line(-1,0){\cutlen}} \put(\border,0){\line(-1,0){\cutlen}}
\put(0,\border){\line(0,-1){\cutlen}} \put(0,\border){\line(0,-1){\cutlen}}
\end{picture} \end{picture}
} }
\newcommand\bl{ \newcommand\bl{
\begin{picture}(0,0) \begin{picture}(0,0)
\thinlines\unitlength1mm \thinlines\unitlength1mm
\put(-\border,0){\line(1,0){\cutlen}} \put(-\border,0){\line(1,0){\cutlen}}
\put(0,-\border){\line(0,1){\cutlen}} \put(0,-\border){\line(0,1){\cutlen}}
\end{picture} \end{picture}
} }
\newcommand\br{ \newcommand\br{
\begin{picture}(0,0) \begin{picture}(0,0)
\thinlines\unitlength1mm \thinlines\unitlength1mm
\put(\border,0){\line(-1,0){\cutlen}} \put(\border,0){\line(-1,0){\cutlen}}
\put(0,-\border){\line(0,1){\cutlen}} \put(0,-\border){\line(0,1){\cutlen}}
\end{picture} \end{picture}
} }
\cropdef[]\tl\tr\bl\br{cut} \cropdef[]\tl\tr\bl\br{cut}
\crop[cut] \crop[cut]
\newcommand\companylogocontent{% \newcommand\companylogocontent{%
\begingroup \begingroup
\edef\BCQ@companylogoscan{\expandafter\detokenize\expandafter{\Xcompanylogo}}% \edef\BCQ@companylogoscan{\expandafter\detokenize\expandafter{\Xcompanylogo}}%
\IfSubStr{\BCQ@companylogoscan}{\string\\}{% \IfSubStr{\BCQ@companylogoscan}{\string\\}{%
\endgroup \endgroup
\Xcompanylogo \Xcompanylogo
}{% }{%
\xdef\BCQ@companylogopath{\BCQ@companylogoscan}% \xdef\BCQ@companylogopath{\BCQ@companylogoscan}%
\endgroup \endgroup
\IfFileExists{\BCQ@companylogopath}{% \IfFileExists{\BCQ@companylogopath}{%
\edef\BCQ@companylogoheightused{1.5em}% \edef\BCQ@companylogoheightused{1.5em}%
\ifcsdef{Xcompanylogoheight}{% \ifcsdef{Xcompanylogoheight}{%
\edef\BCQ@companylogoheightused{\Xcompanylogoheight}% \edef\BCQ@companylogoheightused{\Xcompanylogoheight}%
}{}% }{}%
\includegraphics[height=\BCQ@companylogoheightused]{\BCQ@companylogopath}% \includegraphics[height=\BCQ@companylogoheightused]{\BCQ@companylogopath}%
}{% }{%
\Xcompanylogo \Xcompanylogo
}% }%
}% }%
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
%PDF-1.7
%הנםר
Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 KiB

After

Width:  |  Height:  |  Size: 778 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB