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

clone-pdf-report

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

pdf-report-rename

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="header"/>
 <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 report consists of a header, an abstract, a table of contents, an overview of results and detailed results per host.

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{}
\fancyhead[L]{Vertraulich - Stadtverwaltung Neustadt an der Weinstraße}
\fancyfoot[R]{Seite \thepage}
\fancyfoot[L]{Der Bericht wurde mit OpenVAS generiert.}}
\fancyhead[R]{\includegraphics[width=1cm]{logo}}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{plain}

The headline now looks like this:

head

And here the footer

foot

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s