To fit the whole page
Thi is the easy part. With the geometry
package you can set an unnoticed margin and then fix the size the image to \textwidth
(that now is almost the same that \paperwidth
) and \textheight
(~ \paperheight
). This can produce some distortion if the image have not exactly the same height/width ratio that the paper (e.g. scanned images), but you can obtain the best possible fitting simply adding the keeaspectratio
option:
\documentclass{article}
\usepackage[margin=.1pt]{geometry}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{1.jpg}
\end{document}
Note that here is convenient use some like margin=0.1pt
(or even -0.1pt) with width=\textwidth
or optionally margin=0pt
with width=.99\textwidth
but avoid the perfect fit of margin=0pt
plus width=\textwidth
(then the image can jump to the next page).
For the next pages that must have some margin, you can use use \newgeometry
to restore the margins.
look like written by LaTeX
This is the hard part, since beside match exactly font style, font size and margins (not done in this answer, hard specially if the image is scaled in some extent) your second image also have a page numbers in right header and a lot of empty space.
Assuming that you want add LaTeX in the empty part of this this second page, this involve some others tricks.
One approach (left as exercise) could be put the whole image in the background and left a empty box at the beginning of the page for the already filled part. Then change a empty
style header to one mimicking those showed in the second image.
Another could be a just use a top float, make a simple position adjustement and crop the image (not necessarily the source image):
\documentclass[a4paper]{article}
\usepackage{geometry,lipsum,graphicx}
\usepackage{fancyhdr}
\geometry{margin=0cm}
\usepackage{graphicx}
\begin{document}
\thispagestyle{empty}
{\centering\includegraphics[width=\paperwidth,
height=\paperheight,keepaspectratio]{/home/fran/TR0OT.jpg}}
\newgeometry{margin=4.5cm}
\newpage
\thispagestyle{empty}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrule}{}
\lhead{\thepage}
\begin{figure}[t]
\vspace{-4.5cm}\hspace{-4.5cm}
{\centering\includegraphics[width=\paperwidth,
trim=0cm 40cm 0cm 0cm,clip]{/home/fran/ePIIa.jpg}}
\end{figure}
\section*{This is a LaTeX text}
\lipsum[7-15]
\end{document}
\includegraphics[page=4]{file.pdf}
(or thepdfpages
package has more options)