如何设置\resizebox的边框?

如何设置\resizebox的边框?

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[a4paper,left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{fontspec}
\usepackage[dvipsnames]{xcolor}
\usepackage[object=vectorian]{pgfornament} % also loads tikz
\usepackage{labels, fontawesome}

\setmainfont{Holden}
\tikzset{pgfornamentstyle/.style={draw = Periwinkle,
                                  fill = SpringGreen}}

\usetikzlibrary{
  positioning, % for left=of, above=of etc.
  calc % for let syntax used in second example
}
\LabelCols=1%         Number of columns of labels per page
\LabelRows=1%         Number of rows of labels per page
\LeftBorder=2mm%      Space added to left border of each label
\RightBorder=2mm%     Space added to right border of each label
\TopBorder=2mm%       Space to leave at top of sheet
\BottomBorder=2mm%    Space to leave at bottom of sheet
\numberoflabels=1
\begin{document}
% 
% \begin{center}

    \newsavebox{\orn}
    \savebox{\orn}{
      \resizebox{15cm}{6cm}{
\begin{tikzpicture}[
  every node/.append style={inner sep=0},
  node distance=5mm
]
font=\large
\node [Black] (text) {Vaijan\XeTeXglyph83s Honey};
% in all of the below some fraction of \n1 or \n2 is used to define the width of the ornaments
% set width of these ornaments to half the text node's width
   \node [below= 1mm of text] (below) {\pgfornament[width=2cm,symmetry=c]{69}};
   \node [above = 1mm of text] (above) {\pgfornament[width=2cm]{69}};



% % use \n2 for ornament width here
   \node [rotate=-90, below left=5mm and 1mm of text, anchor=north] (left)  {\pgfornament[width=3cm]{46}}; %M left
   \node [rotate=90, below right=5mm and 1mm of text, anchor=north] (right) {\pgfornament[width=3cm]{46}}; %N right
% % and \n1 here
   \node [above=1mm of above] (top)    {\pgfornament[width=4cm]{71}};%top H
  % 
% %   node [anchor=south] (bottom) at (text.south) {\pgfornament[width=\n1,symmetry=h]{71}}
% % and 25% of width for the corner ornaments
   \node [anchor=north west] at (top.north -| left.south)  {\pgfornament[width=1cm]{63}}; %top left
   \node [anchor=north east] at (top.north -| right.south) {\pgfornament[width=1cm,symmetry=v]{63}}; %top right
%    % draw frame
%   \vspace{2cm};
  \node [below=1mm of below] (addressLineUp) at (below.south) {\pgfornament[width=3.5cm]{88}};
  \setmainfont{Linux Biolinum O}
  font=\normalsize
  \node [Brown, below=1mm of addressLineUp, align=center] (address) {Md.Al-Helal, CSE, DU\\ 01515611989\\\faFacebookSquare{}Honey\&Date};
  \node [below=1mm of address] (addressLineDown) {\pgfornament[width=3.5cm]{88}};
  \node [below=1mm of addressLineDown] (bottom) {\pgfornament[width=4cm]{71}};%G
%   \node [below=of addressLineDown] (bottom) {\pgfornament[width=6cm,symmetry=h]{71}};
  \node [anchor=south west] at (bottom.south -| left.south) {\pgfornament[width=1cm,symmetry=h]{63}}; %bottom left
\node [anchor=south east] at (bottom.south -| right.south) {\pgfornament[width=1cm,symmetry=c]{63}}; % bottom right
% \fill [red] (0, 10) rectangle (-5, 15);
\node[anchor=west, rotate=-90, right=1cm of right] (rightBoxLeft) {\pgfornament[width=2cm]{46}};
\node[anchor=west, right=1mm of rightBoxLeft, align=center] (rightBoxText) {Honey has natural\\ healing power};
\node[anchor=west, rotate=90, right=1mm of rightBoxText] (rightBoxRight) {\pgfornament[width=2cm]{46}};
\node [above=2cm of rightBoxText] (rightBoxTop) {\pgfornament[width=4cm]{71}};%top H
\node [below=2cm of rightBoxText] (rightBoxBottom) {\pgfornament[width=4cm]{71}};%top H
\node [anchor=north west] at (rightBoxTop.north -| rightBoxLeft.south)  {\pgfornament[width=1cm]{63}}; %top left
\node [anchor=north east] at (rightBoxTop.north -| rightBoxRight.south) {\pgfornament[width=1cm,symmetry=v]{63}}; %top right
%    % draw frame
\node [anchor=south west] at (rightBoxBottom.south -| rightBoxLeft.south) {\pgfornament[width=1cm,symmetry=h]{63}}; %bottom left
\node [anchor=south east] at (rightBoxBottom.south -| rightBoxRight.south) {\pgfornament[width=1cm,symmetry=c]{63}}; % bottom right
% \fill [red] (0, 10) rectangle (-5, 15);

% \draw [Blue] (current bounding box.south west) rectangle (current bounding box.north east);
\end{tikzpicture}

}
    }
    \begin{labels}
    \usebox{\orn}
% \end{center}
\end{labels}
\end{document}

通过改变 pgfornament 元素的宽度,输出会缩小/放大。我不明白设计适合我预定义的区域的哪个测量值。

这里,第一个输出框位于右上方。

如果\resizebox显示我使用命令定义的区域,那么我可以轻松了解我的内容是否占用了比定义的更多的空间。

在此处输入图片描述

我想要这样。这个边框显示我有更多的空间来放大我的 pgfornament 元素。这里的红色边框显示了我定义的 resizebox 区域。

相关内容