In This Topic ▼

FILECSVOPTIONS

typedef struct _FILECSVOPTIONS 
{ 
   L_UINT uStructSize; 
   L_CHAR szHeaderFontName[LF_FACESIZE]; 
   L_BOOL bHeaderFontBold; 
   L_BOOL bHeaderFontItalic; 
   L_BOOL bHeaderFontUnderLine; 
   L_INT nHeaderFontSize; 
   L_COLORREF crHeaderFontColor; 
   L_CHAR szBodyFontName[LF_FACESIZE]; 
   L_BOOL bBodyFontBold; 
   L_BOOL bBodyFontItalic; 
   L_BOOL bBodyFontUnderLine; 
   L_INT nBodyFontSize; 
   L_COLORREF crBodyFontColor; 
   L_COLORREF crFirstBackColor; 
   L_COLORREF crSecondBackColor; 
   L_UINT uColorMode; 
   L_INT nTableCellWidth; 
   L_COLORREF crTableBorderColor; 
   L_INT nTableBorderWidth; 
   L_UINT uHorizontalCellAlignment; 
   L_UINT uVerticalCellAlignment; 
} FILECSVOPTIONS, *pFILECSVOPTIONS; 

Options to use when loading CSV files.

Member Description
uStructSize Size of this structure in bytes. Use the sizeof() operator to calculate this value.
szHeaderFontName[LF_FACESIZE] Font family name to use with the header when rendering CSV files.
bHeaderFontBold Use bold font when rendering the header content of CSV files.
bHeaderFontItalic Use italic font when rendering the header of CSV files.
bHeaderFontUnderLine Use underline font when rendering the header of CSV files.
nHeaderFontSize Size of the font to use when rendering the header of CSV files.
crHeaderFontColor Color to use when rendering the header of CSV files.
szBodyFontName[LF_FACESIZE] Font family name to use with the body (content) when rendering CSV files.
bBodyFontBold Bold font when rendering the body content of CSV files.
bBodyFontItalic Italic font when rendering the body content of CSV files.
bBodyFontUnderLine Underlines font when rendering the body content of CSV files.
nBodyFontSize Size of the font when rendering the body (content) of CSV files.
crBodyFontColor Color to use when rendering the body (content) of CSV files.
crFirstBackColor First background color when rendering the rows or columns of CSV files.
crSecondBackColor Second background color when rendering the rows or columns of CSV files.
uColorMode Controls what colors to use for alternating rows when rendering CSV files.
nTableCellWidth Width of table to use when rendering CSV files.
crTableBorderColor Color to draw the table border when rendering CSV files.
nTableBorderWidth Table border width in pixels when rendering CSV files.
uHorizontalCellAlignment Table border width in pixels when rendering CSV files.
uVerticalCellAlignment Vertical alignment of the cell when rendering CSV files.

Comments

CSV files have no physical width or height in pixels but you can use the RASTERIZEDOCOPTIONS to control how the final document is rendered as a raster or SVG image. For more information, refer to LEADTOOLS Document Writer Formats.

LEADTOOLS renders CSV files using a table with rows and cells.

See Also

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.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help