
我正在努力打造我的名片。對於第一個來說沒有什麼特別的。在背面,會有一個二維碼連結到我的http://card.vcf。
在正面,我的主要訊息位於卡片的中心/左側,右側部分(大約右側的 15-20%)將帶有我的徽標(我正在考慮使用表格來進行這些分隔,或 makebox、haven直到現在才真正考慮過它。我希望它只出現在名片的正面:
也許為了簡化,我會在上面添加我的徽標,因為這個背景與名片的大小相同。
問題是:根據我的幾何形狀,藍色不會出現在我等待他的地方。如果我評論關於以下內容的行: \usepackage[]{geometry} ....我得到了帶有我的背景的 A4 格式。
我嘗試過: \usepackage{eso-pic} \usepackage{background} 並嘗試了“\makebox”,但我無法與任何人實現。我在範例程式碼中對它們進行了註釋。
如果有人知道我缺少什麼才能使其發揮作用,我將非常感謝您的幫助。
\documentclass[10pt]{memoir}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{qrcode}
\usepackage[paperheight=5cm,paperwidth=9cm]{geometry}
\pagestyle{empty}
\usepackage{graphicx}
%\usepackage{background}
%\newcommand\BackImage[2][scale=1]{%
%\BgThispage\backgroundsetup{contents={\includegraphics[#1]{#2}}}
%\usepackage{eso-pic}
%\newcommand\BackgroundPic{%
%\put(0,0){%
\parbox[b][5cm]{9cm}{\vfill\centering\includegraphics[width=9cm,keepaspectratio]{160606-fond_carte_visite.png}\vfill}}}
\begin{document}
%\AddToShipoutPicture*{\BackgroundPic}
\makebox[0pt][l]{%
\raisebox{-\totalheight}[0pt][0pt]{%
\includegraphics[width=8.99cm,height=4.5cm]{160606-fond_carte_visite.png}}%}%
%\BackImage[width=\textwidth]{160606-fond\_carte\_visite.png}%
FirstName Lastname\\
Address\\
\newpage
\qrcode[height=15mm]{https://example.com/card.vcf}
\end{document}
答案1
像這樣嗎?
\documentclass[10pt,landscape]{article}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\begin{document}
\begin{tikzpicture}[remember picture,overlay,shift={(current page.south west)}]
\node[anchor=south west] (0,0) {\includegraphics[width=\paperwidth,height=\paperheight]{pig}};
\end{tikzpicture}
\end{document}
我使用風景是因為這就是我的圖片的方向。
答案2
在@JPi 的幫助下以及這個問題的答案:tikzpicture 的背景圖片不適合整個頁面,我讓我的背景圖像符合我的意願:
(...)
\usepackage[paperheight=5cm, paperwidth=9cm, left=0mm, bottom=0mm]{geometry}
(...)
\begin{tikzpicture}[remember picture,overlay,shift={(current page.center)}]
\node[inner sep=0] {\includegraphics[width=\paperwidth,height=\paperheight]{my_background.png}};
\end{tikzpicture}