Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Common
PlayMetaFileFromHandle

See Also Example
Collapse All

This method adds a metafile from a handle to a PDF document.

Syntax

HRESULT PlayMetaFileFromHandle (
OLE_HANDLE metafileHandle,
FLOAT x,
FLOAT y,
FLOAT scaleX,
FLOAT scaleY
)
Parameters
metafileHandle
Handle of the metafile to be painted

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 handle) on the page at specified coordinates (x, y) with scaling (scaleX, scaleY).

Example

Converting EMF Files

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
hMetafile := GetEnhMetaFile('page.emf');
PDF.PlayMetaFileFromHandle(hMetafile, 10, 10, 0.5, 0.5);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
HENHMETAFILE hMetafile = GetEnhMetaFile("page.emf");
PDF->PlayMetaFileFromHandle((OLE_HANDLE)hMetafile, 10, 10, 0.5, 0.5);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
HENHMETAFILE hMetafile = GetEnhMetaFile("page.emf");
PDF.PlayMetaFileFromHandle(hMetafile, 10, 10, 0.5, 0.5);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
HENHMETAFILE hMetafile = GetEnhMetaFile("page.emf")
PDF.PlayMetaFileFromHandle hMetafile, 10, 10, 0.5, 0.5
PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots