# MakeMetafile Method

## Applies to

THtmlViewer component

## Declaration

function MakeMetafile(YTop, FormatWidth, Width, Height: integer): TMetafile;

## Description

The MakeMetafile method produces a metafile of a portion of the document currently loaded.

YTopThe top of the metafile in pixels. 0 would be the start of the document.

FormatWidthThe width to which the HTML is to be formatted. Text would typically wrap at this width.

WidthThe width of the metafile. This might be greater than FormatWidth.

HeightThe height of the metafile.

Usage Notes

Currently, the maximum Height allowed is 4000 pixels so some sort of paging is required for large documents.

Before calling MakeMetafile, use the FullDisplaySize method to ascertain the overall formatted size so that the MakeMetafile parameters can be properly set. The Width returned by FullDisplaySize may exceed FormatWidth if the contents can't be successfully wrapped. This Width should be used to specify the metafile width. Alternatively, FormatWidth may be set to this Width and FullDisplaySize called again to obtain the new Height.

To make a series of metafiles that can be pieced together, use values for YTop of 0, Height, 2*Height, etc.

## See Also:

FullDisplaySize Method

MakeBitmap Method

MakePagedMetafiles Method