I'm inserting an pdf file for a section with the command \includepdf[scale=0.9,pagecommand=\section*{\begin{center}
ANEXO
\end{center}}]{Oficio5S.pdf}
, so the pdf is inserted in the page of the APPENDIX and not in a new page.
But, the title "APPENDIX" it's below from where it should be (fitting the top margin). So, how can I fix this?
Another issue, what can I do to insert the pdf file with a size that fits the document margins, but the pdf file included must stays above the title of the section?
Image:
Code:
\documentclass[12pt,a4paper]{article}
\pagestyle{myheadings}
\usepackage[utf8]{inputenc}
\usepackage[brazilian]{babel}
\usepackage[T1]{fontenc} %code
\usepackage{uarial} % for
\renewcommand{\familydefault}{\sfdefault} %arial font
\usepackage{pdfpages}
\usepackage[top=2cm,left=2cm,right=2cm,bottom=2cm]{geometry}
\usepackage{titlesec}
\titleformat*{\section}{\normalsize\bfseries}
\begin{document}
\includepdf[scale=0.9,pagecommand=\section*{\begin{center}
APPENDIX \end{center}}]{Oficio5S.pdf}
\newpage
textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt textetxttextetxttextetxttextetxttextetxt
\end{document}
There's a page with text for the sake of margin comparation.
\includegraphics[trim=<....>, clip=true,page=<...>]{file}