# OpenVAS: PDF report insert head an foot

My first attempt to modify a pdf report can be found here: CUSTOMIZING PDF-REPORTS

In the next step, I want to insert headers and footers.

For this reason, I have cloned the original report and modified it. This article describes the procedure

## Clone existing PDF report

Then the new report can be renamed. Important is the ID to find the associated files on the server

Cloned reports are in the directory
/usr/local/var/lib/openvas/openvasmd/report_formats/

In my case in the subdirectory 33d5569b-c2f6-4455-9cc1-4a9bf0d35879.

## Modify the new latex.xsl

First a security copy of the xsl file

root@sv-openvas /usr/local/var/lib/openvas/openvasmd/report_formats/2fc54359-0c7e-4e03-b00b-2479f7354f06/33d5569b-c2f6-4455-9cc1-4a9bf0d35879 # cp latex.xsl latex.xsl.orig

The xsl file is relatively large, but can be edited with notepad++ quite comfortably. To understand the structure of the report, take a look at the end of the file.

 <!-- The actual report. -->
<xsl:template name="real-report">
<xsl:call-template name="newline"/>
<xsl:text>\begin{document}</xsl:text><xsl:call-template name="newline"/>
<xsl:call-template name="newline"/>
<xsl:text>\maketitle</xsl:text><xsl:call-template name="newline"/>
<xsl:call-template name="abstract"/>
<xsl:call-template name="toc"/>
<xsl:text>\newpage</xsl:text>
<xsl:call-template name="newline"/>
<xsl:call-template name="results-overview"/>
<xsl:call-template name="results-per-host"/>
<xsl:text>

The necessary commands I inserted in the template with the name header. In addition to the already used package graphicx, now additional fancyhdr is used. The logo must also be in the corresponding directory.

fancyfoot and fancyheader can be used with 3 options:

• L = left
• R = right
• C = center
%Head and foot
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[R]{Seite \thepage}
\fancyfoot[L]{Der Bericht wurde mit OpenVAS generiert.}}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{plain}

The headline now looks like this:

And here the footer

## 2 thoughts on “OpenVAS: PDF report insert head an foot”

1. Hi,
Thank you so much for this tutorial! You saved me days of work 🙂
I’ve got a shiny logo, and header+footer on my first page now, thanks to you.
I also changed to a much nicer font with the command:

\usepackage{tgbonum}

However, only the first page of my report was modified with the header/footer.
Do you know how to apply them to the whole document?

Regards,

Damien

Liked by 1 person

1. search for the section “Section with Results per Host” and insert the lines:

\pagestyle{fancy}
\fancyhf{}