←Select platform

CodecsCsvLoadOptions Class

Summary

Options to use when loading CSV files.

Syntax
C#
VB
C++
public class CodecsCsvLoadOptions 
Public Class CodecsCsvLoadOptions 
public: 
   ref class CodecsCsvLoadOptions 

Remarks

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

LEADTOOLS renders CSV files as a table with rows and cells. CodecsCsvLoadOptions contains properties to control the font, color, and size of the output.

Example
C#
VB
using Leadtools; 
using Leadtools.Codecs; 
 
public static void CodecsCsvOptions_Example() 
{ 
   string csvFileName = Path.Combine(LEAD_VARS.ImagesDir, "sample.csv"); 
   string pngFileName = Path.Combine(LEAD_VARS.ImagesDir, "sample-csv.png"); 
 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      // Change some CSV options 
      CodecsCsvLoadOptions csvOptions = codecs.Options.Csv.Load; 
      csvOptions.HeaderFontItalic = true; 
      csvOptions.BodyFontName = "Arial"; 
      csvOptions.TableBorderColor = RasterColor.FromKnownColor(RasterKnownColor.Red); 
 
      // Load the first page from a CSV file 
      using (RasterImage image = codecs.Load(csvFileName, 1)) 
      { 
         // Save it as PNG 
         codecs.Save(image, pngFileName, RasterImageFormat.Png, 0); 
      } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
 
Public Shared Sub CodecsCsvOptions_Example() 
   Dim csvFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "sample.csv") 
   Dim pngFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "sample-csv.png") 
 
   Using codecs As New RasterCodecs() 
      ' Change some CSV options 
      Dim csvOptions As CodecsCsvLoadOptions = codecs.Options.Csv.Load 
      csvOptions.HeaderFontItalic = True 
      csvOptions.BodyFontName = "Arial" 
      csvOptions.TableBorderColor = RasterColor.FromKnownColor(RasterKnownColor.Red) 
 
      ' Load the first page from a CSV file 
      Using image As RasterImage = codecs.Load(csvFileName, 1) 
         ' Save it as PNG 
         codecs.Save(image, pngFileName, RasterImageFormat.Png, 0) 
      End Using 
   End Using 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

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

Leadtools.Codecs Assembly