L_GetEmfHandleFromRtf

Summary

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

Syntax

#include "l_bitmap.h"

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

Parameters

L_TCHAR * pRtfFileName

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

L_INT 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.

pFILERTFOPTIONS pRtfOptions

Pointer to a structure that contains the options to be used when loading RTF file. The following options will be used: RTFFILEOPTIONS.crBackColor.

pRASTERIZEDOCOPTIONS pRasterizeDocOptions

Pointer to a structure that contains the options to be used when rasterizing document files. The following options will be used: RASTERIZEDOCOPTIONS.uXResolution, RASTERIZEDOCOPTIONS.uYResolution, RASTERIZEDOCOPTIONS.dPageHeight, RASTERIZEDOCOPTIONS.dPageWidth, RASTERIZEDOCOPTIONS.dLeftMargin, RASTERIZEDOCOPTIONS.dTopMargin, RASTERIZEDOCOPTIONS.dRightMargin and RASTERIZEDOCOPTIONS.dBottomMargin

HENHMETAFILE * hEmfHandle

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

Returns

Value Meaning
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 pRasterizeDocOptions.

Required DLLs and Libraries

Platforms

Win32, x64

See Also

Functions

Topics

Example

This example gets Emf handle from Rtf file.

L_INT GetEmfHandleFromRtfExample(L_TCHAR* pRtfFileName, L_INT nPageNumber, HENHMETAFILE* hEmfHandle) 
{ 
   FILERTFOPTIONS FileRtfOptios; 
   RASTERIZEDOCOPTIONS RasterizeDocOptions; 
 
   memset(&FileRtfOptios, 0, sizeof(FILERTFOPTIONS)); 
   FileRtfOptios.uStructSize = sizeof(FILERTFOPTIONS); 
   FileRtfOptios.crBackColor = RGB(255,255,255); 
 
   memset(&RasterizeDocOptions, 0, sizeof(RASTERIZEDOCOPTIONS)); 
   RasterizeDocOptions.uXResolution = 96; 
   RasterizeDocOptions.uYResolution = 96; 
   RasterizeDocOptions.dPageWidth = 8.5; 
   RasterizeDocOptions.dPageHeight = 11.0; 
   RasterizeDocOptions.dLeftMargin = 1.0; 
   RasterizeDocOptions.dTopMargin = 1.0; 
   RasterizeDocOptions.dRightMargin = 1.0; 
   RasterizeDocOptions.dBottomMargin = 1.0; 
 
   return L_GetEmfHandleFromRtf(pRtfFileName, nPageNumber, &FileRtfOptios, &RasterizeDocOptions, hEmfHandle); 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.