L_GetEmfHandleFromRtf

#include "l_bitmap.h"

L_LTFIL_API L_INT EXT_FUNCTION L_GetEmfHandleFromRtf (pRtfFileName, nPageNumber, pRtfOptions, hEmfHandle)

L_TCHAR * pRtfFileName;

/* file name */

L_INT nPageNumber;

/* page number */

pFILERTFOPTIONS pRtfOptions;

/* pointer to a structure */

HENHMETAFILE * hEmfHandle;

/* pointer to an EMF handle */

Gets an EMF handle from a specific page in RTF file.

Parameter

Description

pRtfFileName

Character string that contains the name of the source RTF file.

nPageNumber

Number of the RTF page to get its EMF handle. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, etc.

pRtfOptions

Pointer to a structure that contains the options to be used when loading RTF file.

hEmfHandle

Address of an Enhanced Metafile (EMF) handle that will be updated with the obtained EMF.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The number of RTF pages depends on page settings values inside pRtfOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64

See Also

Functions:

L_SetRTFOptions, L_GetRTFOptions

Topics:

Raster Image Functions: Loading Files

 

Loading and Saving Images

Example

//This example gets Emf handle from Rtf file

L_INT GetEmfHandleFromRtfExample(L_TCHAR* pRtfFileName, L_INT nPageNumber, HENHMETAFILE* hEmfHandle)
{
   FILERTFOPTIONS FileRtfOptios;

   FileRtfOptios.uStructSize = sizeof(FILERTFOPTIONS);
   FileRtfOptios.crBackColor = RGB(255,255,255);
   FileRtfOptios.dTopMarg = FileRtfOptios.dLeftMarg = FileRtfOptios.dRightMarg = FileRtfOptios.dBottomMarg = 1.0;
   FileRtfOptios.nXResolution = FileRtfOptios.nYResolution = 96;
   FileRtfOptios.dPaperWidth = 8.5;
   FileRtfOptios.dPaperHeight = 11.0;

   return L_GetEmfHandleFromRtf(pRtfFileName, nPageNumber, &FileRtfOptios, hEmfHandle);
}
#endif // #if defined(LEADTOOLS_V17_OR_LATER)