简体   繁体   中英

CSV to PDF file in c#

I am trying to convert a comma separated string(CSV) file to pdf file in C# using the iTextSharp library. I would like to know if there is any other free or more efficient tool/way for this type of conversion.

You can use iTextSharp

Here's an example:

Document pdfDoc = new Document();
string path = @"c:\file.pdf";
PdfWriter writer = PdfWriter.GetInstance( pdfDoc, new FileStream(path, FileMode.OpenOrCreate));
pdfDoc.Open();
pdfDoc.Add(new Paragraph("your data"));
pdfDoc.Close();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM