PlayEMF
IPDFDocument3 :: General document methods

See Also Example
Collapse All

This method adds a metafile to a PDF document.

Syntax

HRESULT PlayEMF (
LONG metafileHandle,
LONG reserved,
DOUBLE x,
DOUBLE y,
DOUBLE scaleX,
DOUBLE scaleY
)
Parameters
metafileHandle
Handle of the metafile

reserved
Reserved (Must be 0)

x
X coordinate of the drawing position.

y
Y coordinate of the drawing position.

scaleX
Horizontal scale factor.

scaleY
Vertical scale factor.

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method paints the context of the metafile (provided by the handle) on the page at the specified coordinates (x, y) with scaling (scaleX, scaleY).

Equivalent in new interface: IPDFDocument4::PlayMetaFileFromHandle.

Example

Using the PlayEMF Method

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.UseScreenDC := true;
PDF.BeginDoc;
HENHMETAFILE hMetafile := GetEnhMetaFile('logo.emf');
PDF.PlayEMF(hMetafile, 0, 10, 10, 1.0, 1.0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->UseScreenDC = TRUE;
PDF->BeginDoc();
HENHMETAFILE hMetafile = GetEnhMetaFile("logo.emf");
PDF->PlayEMF(hMetafile, 0, 10, 10, 1.0, 1.0);
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.UseScreenDC = true;
PDF.BeginDoc();
HENHMETAFILE hMetafile = GetEnhMetaFile("logo.emf");
PDF.PlayEMF(hMetafile, 0, 10, 10, 1.0, 1.0);
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.UseScreenDC = True
PDF.BeginDoc
HENHMETAFILE hMetafile = GetEnhMetaFile("logo.emf")
PDF.PlayEMF hMetafile, 0, 10, 10, 1.0, 1.0
PDF.EndDoc

See Also

Reference