页面末尾的 Paracols 内的颜色框

页面末尾的 Paracols 内的颜色框

我目前正在实现一个动态 PDF 创建器。因此我需要将 paracol 环境的最后两列始终放在页面的末尾(底部)。有什么方法可以实现这一点吗?

它看起来应该是这样的(带有黑色边框的灰色块是敏感信息): 在此处输入图片描述

但灰色块应该位于页面末尾,并应从下到上“增长”。

目前状态(静态内容):

\documentclass[14pt,parskip=full,oneside,a4paper]{article}
\usepackage[
  left = 16mm,
  right = 16mm,
  textwidth = 178mm,
  top = 20mm,
  bottom=22mm,
  % headheight=17pt, % as per the warning by fancyhdr
  % includehead,
  includefoot,
  % heightrounded, % to avoid spurious underfull messages
]{geometry}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\usepackage{float}
\graphicspath{{images/}}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage[export]{adjustbox}
\usepackage[document]{ragged2e}
\usepackage{ifthen}
\setlength{\parindent}{0em}
\setlength{\parskip}{0em}
\renewcommand{\baselinestretch}{0.0}

\usepackage{paracol}

% Custom Colors
\definecolor{customred}{HTML}{E10000}
\definecolor{customgray}{HTML}{878787}
\definecolor{customlightgray}{HTML}{DCDCDC}

% Custom Commands
\newcommand{\ct}[2]{
  \textcolor{#1}{#2}
}
\newcommand{\productHeader}[2]{
  \begin{paracol}{2} % this is what I want
    \includegraphics[width=37mm,height=11mm]{}
  \switchcolumn
    \begin{flushright}
      \textbf{\ct{customred}{\fontsize{18}{22}\selectfont #1}}\\
      \ct{customgray}{\fontsize{9.5}{14}\selectfont #2}
    \end{flushright}
  \end{paracol}
}

\newcommand{\productTitle}[2]{
  \textbf{\ct{customred}{\fontsize{12,5}{16}\selectfont #1}}\\
  \vspace{8,8mm}
  \textbf{\ct{customgray}{\fontsize{9.5}{14}\selectfont #2}}\\
  \vspace{4mm}
  {\color{customred}\rule{23mm}{1mm}\hfill}\\
  \vspace{12mm}
}
\newcommand{\productDescription}[2]{
  \vspace{12mm}
  \textbf{\ct{black}{\fontsize{9,5}{14}\selectfont #1}}\\
  {\fontsize{9,5}{14}\selectfont #2}
}

\newcommand{\productBottom}[2]{
  \textbf{\ct{customred}{\fontsize{9,5}{14}\selectfont #1}}\\
  \begin{tcolorbox}[boxsep=0pt,top=3mm,left=3mm,right=3mm,bottom=3mm,arc=0pt,auto outer arc,colback=customlightgray,colframe=customlightgray]
    % \begin{minipage}[b]{80mm}
      \textbf{\fontsize{9,5}{14}\selectfont #2}
      % \vfill
    % \end{minipage}
  \end{tcolorbox}
}
\newcommand{\productIcon}[2]{
  \centering
  \ifthenelse{\equal{#2}{true}}{
    \includegraphics[width=13mm,height=13mm]{images/icons/#1.png}
  }{\includegraphics[width=13mm,height=13mm]{images/icons/#1_grau.png}}

}
\newcommand{\productIcons}[4]{
  \begin{figure}[H]
    \centering
    \hfill
      \subfigure{{\productIcon{Quality}{#1}}}%
    \hfill
      \subfigure{{\productIcon{Availability}{#2}}}%
    \hfill
      \subfigure{{\productIcon{Obsolescence}{#3}}}%
    \hfill
      \subfigure{{\productIcon{Performance}{#4}}}%
    \hfill
  \end{figure}
}
\newcommand{\productImage}[1]{
  \includegraphics[width=86mm,height=55mm]{#1}
}

\usepackage{fancyhdr}
\setlength{\headheight}{0pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.25mm}
\renewcommand{\footrule}{\hbox to\headwidth{\color{customgray}\leaders\hrule height \footrulewidth\hfill}}
\pagestyle{fancy}
\fancyhf{} % clear all fields
%  Custom Footer
\fancyfoot[L]{\vspace{7mm}
  \textbf{\ct{customgray}{\fontsize{9}{14}\selectfont FUTURE - MADE BY EXAMPLE}}
}
\fancyfoot[R]{\vspace{7mm}
  \ct{black}{\fontsize{9}{14}\selectfont Contact: [email protected] \hspace{30mm}www.test.com}
}

\usepackage{blindtext}
\begin{document}
\setcolumnwidth{86mm,86mm} % this should only affect the 3 column
\setlength{\columnsep}{6mm}
\productHeader
{ARIAL BOLD 18/22PT\\
LOREM IPSUM}
{Arial Regular 9,5/14 PT 878787\\
    Lorem Ipsim\\
    Lorem\\
Ipsum}

\begin{paracol}{2}
    \productTitle{LOREM IPSUM ARIAL BOLD 12,5/16PT}{IPSUM Arial Bold 9,5/14PT 878787}
    \productDescription{DESCRIPTION ARIAL BOLD 9,5/14 PT 000000}
    {Arial Regular 9,5/14 \blindtext[1]}
    \switchcolumn
    \productImage{test.png}
    \productIcons{false}{true}{false}{false}
    \switchcolumn*
    \productDescription{BENEFITS}
    {\blindtext[1]}
    \switchcolumn
    \productDescription{FEATURES}{
        \begin{itemize}
            \item 1232
        \end{itemize}
        }\null\vfill\null
    \switchcolumn*
\end{paracol}


\par\vbox{}\null\vfill\nopagebreak
\begin{paracol}{2} %End of Site (gray blocks)
    \productBottom{OPTIONAL EQUIPMENT 9,5 PT E10000}
    {Arial Bold 9,5/14 PT  Loraerro volor sequisto omnihil iandundae corio estrum apictas et labore rem reped enda nonsequ idicitia aut utectate eaquos sum ilique etum, alit explibus.\\ Lum ut ame peritas et lame voluptibus.}
    \switchcolumn
    \productBottom{REQUIREMENTS}
    {Loraerro volor sequisto omnihil iandundae corio estrum apictas et labore rem reped enda nonsequ idicitia aut utectate eaquos sum ilique etum, alit explibus.\\ Lum ut ame peritas et lame voluptibus. Represtores excestem. Accusa voluptae con coribus, qui dis nonem et quia dolut dit illuptat mo quam, que doloris citatam am, offictis veniet}
\end{paracol}

\end{document}

您对如何使用 paracols 解决这个问题有什么想法吗?

编辑 主要问题:如何动态填充文本(“好处”之后)和灰色框之间的区域。这样,灰色框就会始终位于页面底部。\vfill所有类似的解决方案都不起作用。

答案1

最后我使用以下解决方案代替 paracol:

\newtcbox{\bottomBox}[1][]{%
  width=85mm,
  boxsep=0pt,
  top=3mm,left=3mm,right=3mm,bottom=3mm,
  arc=0pt,auto outer arc,
  colback=lightgray,colframe=lightgray,
  boxrule=0mm,box align=base,on line,
  #1, enhanced,attach boxed title to top left={xshift=-2mm},
  boxed title style={size=small,colframe=white!0,colback=white!0,},
  coltitle=red,fonttitle=\bfseries
}

\newcommand{\productBottom}[4]{
  \par\vbox{}\null\vfill\nopagebreak

  \begin{tcbraster}[raster columns=2,raster equal height,
                    nobeforeafter,raster column skip=6mm]
    \bottomBox[title={\fontsize{9,5}{14}\selectfont #1}]{
        \textbf{\fontsize{9,5}{14}\selectfont #2}
    }
    \bottomBox[title={\fontsize{9,5}{14}\selectfont #3}]{
        \textbf{\fontsize{9,5}{14}\selectfont #4}
    }
  \end{tcbraster}
}

并在文档中像这样使用它:

\productBottom
  {Test Title Left}
    {Test Text Left}
  {Test Title Right}
    {Test Text Right}

相关内容