Hi,
Well, I think you may open/load the CSV file/data from streams (you have to build the streams by your own codes for your needs accordingly) and then convert to your desired PDF format.
e.g
//…
Workbook book = new Workbook(stream, new LoadOptions(LoadFormat.CSV));
book.Save(“output.pdf”, SaveFormat.Pdf);
Also, if you could save your CSV data to an Array or datatable, you may import that array at once using Cells.ImportArray() method, see the document for your reference:
Moreover, I have pasted a simple example on how to create CSV and PDF files from the StringBuilder here.
Sample code:
Workbook wb = new Workbook();
Worksheet wks = wb.Worksheets[0];
StringBuilder sb = new StringBuilder();
Random random = new Random();
for (int i = 0; i <= random.Next(1, 50); i++)
{
sb.Append("Test one. ");
sb.Append("Test two. ");
sb.Append("Test three. ");
sb.Append("Test four. ");
sb.Append("Test five. ");
}
wks.Cells[0, 0].PutValue(sb.ToString());
wks.Cells[1, 0].PutValue(sb.ToString());
wks.AutoFitRows();
wb.Save(“out1.csv”, SaveFormat.CSV);
wb.Save(“output2.pdf”, SaveFormat.Pdf);
Hope, this helps you.
thank you.