I remember asking the very same question several years ago, because of a figure in my Dipl.Ing. thesis which started an interesting discussion but didn't ended in a solution. This was before TikZ came up.
–
Martin Scharrer♦Mar 29 '11 at 16:05

However, it is also possible without this special node by using two tikzpicture (one to set the start coordinate) as demonstrated by Herbert for PSTricks in Stretching a framebox over the whole page. In TikZ and for a figure this looks like:

You can use TikZ for that. In allows you to calculate the amount of the rest of the page. Note that this needs two compiler runs to work.
Here my solution for Stretching a framebox over the whole page adapted to include an image instead of a frame-box. Because this isn't 100% trivial for beginners (of LaTeX and/or TikZ) I think this isn't a duplicate.

You might add width=\textwidth,keepaspectratio to the \includegraphics options to ensure that the image isn't scaled wider than the text width.

Note that above code doesn't work inside a float because the tikzpicture is kind of anchored to the page and the float isn't by definition. The use of a non-floating environment is therefore required. In this specific case the figure should not float anyway. The best solution I can image is to place the caption as part of the tikzpicture using \captionof{float}{...} of the caption environment. Otherwise the tikpicture will overlay the caption.

The following code places the caption at the very end of the page (i.e. text area of the page) and scales the image so that it goes from the current position to the top of the caption plus \abovecaptionskip:

This is a very long and roundabout way. Aditya's code below, although mentioned as used by ConTeXt can be used with pdflatex as well. Both the \pagegoal as well as \pagetotal are TeX primitives. Second problem will be that if you only scale the image using height, it is quite likely that it will exceed the width of the page and produce a bad box. One needs to check both the new width as well as the new height of the image and rather stretch the in between spaces a bit if necessary.
–
Yiannis LazaridesMay 11 '11 at 3:49

@Yiannis: The code can be easily put into a macro (in the preamble or a package) and then is much more compact to use. I kept the trivial adjustment of the width as an exercise to the reader ;-) Also I like the flexibility of this TikZ code which I already used for a couple of other answers.
–
Martin Scharrer♦May 11 '11 at 6:56

@Bruno Le Floch Yes it does not need to be that complicated. Both pagegoal as well as pagetotal are TeX primitives so one wouldn't have a problem using this code with any of the engines. But really ConTeXt is three steps ahead of LaTeX at the moment.
–
Yiannis LazaridesMay 11 '11 at 3:51

@Yiannis: Are \pagegoal and \pagetotal really reliable? I once got told that in certain situations TeX can accumulate several pages worth of material before deciding about the page breaking. Therefore always the need to go through the .aux file. Or do this primitives do this?
–
Martin Scharrer♦May 11 '11 at 6:59

3

Works indeed with LaTeX as well as long \lineheight is replaced: \includegraphics[height=\dimexpr\pagegoal-\pagetotal-\baselineskip\relax,width=‌​\textwidth,keepaspectratio]{image}
–
Martin Scharrer♦May 11 '11 at 7:19

1

@Martin no there is no primitive for line goal, as TeX optimizes paragraphs and not lines based on demerits. pdfTEX's has \pdfsavepos. A TeX solution would be to place box the paragraph and then unbox it line by line and compare against a marker or with the textwidth values. Here I think a TikZ solution is more appropriate (another way is to use LaTeX pic commands and do some calculations).
–
Yiannis LazaridesMay 11 '11 at 13:06