I'm trying to make an equal header and footer from the image below

I saved the header and footer as an image. Below my attempt, the header was right, but the text was left without left margin and without bottom margin

\documentclass[a4paper, 12pt]{article}
\usepackage[top=3cm, bottom=4.3cm, left=3cm, right=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphics,graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[fontsize=12pt]{scrextend}

%\renewcommand{\footrulewidth}{1pt}

\cfoot{\includegraphics[height=2.3cm]{g.png}}

\begin{document}

\lipsum

\end{document}


• Just a guess: You want these not in the header*/*footer, but instead across the entire page width at the top*/*bottom of the page... is this the case? – Werner Oct 20 '17 at 21:36
• yes, I will try here by placing upper margin 0pt and add the image at the top. – Marcelo Rodrigues Oct 20 '17 at 21:43
• Do you want this only on the first page, or on every page? – Werner Oct 20 '17 at 21:45
• every page. the footer I was able to do using \ cfoot, the image above can not make it stay in the width of the page, it obeys the left margin – Marcelo Rodrigues Oct 20 '17 at 21:46

The follow code uses eso-pic to place the respective images at the top and bottom of the page boundary. This way you can still set a regular header/footer and/or change the page geometry without affecting the placement.

\documentclass{article}

\usepackage{graphicx,eso-pic}
\usepackage{lipsum}

\AtPageUpperLeft{%
\raisebox{-\height}{\includegraphics[width=\paperwidth]{k.png}}
}
\AtPageLowerLeft{%
\makebox[\paperwidth]{\includegraphics[height=2.3cm]{g.png}}
}%
}

\begin{document}

\lipsum

\end{document}

• Thank you very much, solved my problem. I just changed the image below because in the original template below the image still has the margin and will not number, I used the \ cfoot. One question, is it possible to use some command to make the images more opaque? In the original Word template, the images appear more opaque – Marcelo Rodrigues Oct 20 '17 at 22:08
• @MarceloRodrigues: More opaque? No. Less opaque (or more transparent)? Yes. Load the transparent package (\usepackage{transparent} in your preamble) and then include \transparent{<value>} just before using \includegraphics. A <value> of 0.5[0.1] would make the image 50% [10%] opaque. Requires at least two compilations. – Werner Oct 20 '17 at 22:17
• When I put the command \ transparent {0.5}, \cfoot{\transparent{0.5}\includegraphics[width=\textwidth]{g.png}}, the image goes a little further down, any suggestions? – Marcelo Rodrigues Oct 20 '17 at 22:49
• @MarceloRodrigues: I see this output when using this code. It places the header/footer in the background with different transparencies on the two-page document. There is no movement of the images with/without \transparent{<value>}. – Werner Oct 20 '17 at 23:24
• @MarceloRodrigues: You can use \raisebox{<dim>}{\makebox[\paperwidth]{\includegraphics[height = 2.3cm]{g.png}}} in order to raise the included image by <dim>. That way you can still use the regular header/footer for whatever (page numbers or something else). – Werner Oct 21 '17 at 1:36

Like this? I had to define values for \fancyhfoffset on both sides, equal to the left and right margins:

\documentclass[a4paper, brazil, 12pt]{article}
\usepackage[top=120pt, bottom=4.3cm, left=3cm, right=2cm, headheight=95pt, footskip=66pt]{geometry}%
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[fontsize=12pt]{scrextend}

%\renewcommand{\footrulewidth}{1pt}

\fancyhfoffset[L]{3cm}\fancyhfoffset[R]{2cm}


• Good solution. When I put the command \ transparent {0.5}, \cfoot{\transparent{0.5}\includegraphics[width=\textwidth]{g‌​.png}}, the image goes a little further down, any suggestions? – Marcelo Rodrigues Oct 20 '17 at 22:54
• @MarceloRodrigues: Not really. Maybe try \makebox[0pt]{\inclcludegraphics{...}}? – Bernard Oct 20 '17 at 23:07
• Many thanks, it worked out using \cfoot{\makebox[0pt]{\transparent{0.5}\includegraphics[width=\textwidth]{g.png}}} – Marcelo Rodrigues Oct 20 '17 at 23:32