L_SetCSVOptions

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetCSVOptions(pCsvOptions)

Sets the file options used by LEADTOOLS when loading CSV files.

Parameters

pFILECSVOPTIONS pCsvOptions

Pointer to a structure that contains the options used when loading CSV files.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

To get the current options used when loading a CSV file, call L_GetCSVOptions.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Datatypes

Example

static L_INT CsvOptionsExample() 
{ 
   L_TCHAR* csvFileName = MAKE_IMAGE_PATH(TEXT("sample.csv")); 
   L_TCHAR* pngFileName = MAKE_IMAGE_PATH(TEXT("sample-csv.png")); 
 
   // Change some CSV options 
 
   // First get the current options 
   FILECSVOPTIONS csvOptions; 
   L_INT nRet = L_GetCSVOptions(&csvOptions, sizeof(csvOptions)); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   // Modify some properties 
   csvOptions.bHeaderFontItalic = true; 
   wcscpy_s(csvOptions.szBodyFontName, TEXT("Arial")); 
   csvOptions.crTableBorderColor = RGB(0xFF, 0x00, 0x00); // Red 
 
   // Set them 
   nRet = L_SetCSVOptions(&csvOptions); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   // Load the first page from a CSV file 
   BITMAPHANDLE bitmapHandle; 
   nRet = L_LoadBitmap(csvFileName, &bitmapHandle, sizeof(bitmapHandle), 0, ORDER_BGRORGRAY, NULL, NULL); 
 
   // Save as PNG 
   if (nRet == SUCCESS) 
      nRet = L_SaveBitmap(pngFileName, &bitmapHandle, FILE_PNG, 0, 0, NULL); 
 
   if (bitmapHandle.Flags.Allocated) 
      L_FreeBitmap(&bitmapHandle); 
 
   return nRet; 
} 
Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help