You can find all details here: Convert CSV to PDF or PDF to CSV Programmatically using C# VB.NET
Last active
June 15, 2023 09:41
-
-
Save aspose-com-gists/e7836763c0ea85cdb50c9cf4f34c40d6 to your computer and use it in GitHub Desktop.
Convert CSV to PDF or PDF to CSV Programmatically using C# VB.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize TxtLoadOptions class object | |
Aspose.Cells.TxtLoadOptions option = new Aspose.Cells.TxtLoadOptions(); | |
option.Separator = ','; | |
// Load the input CSV file | |
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(dataDir + "Test.csv" , option); | |
// Save output PDF file | |
workbook.Save(dataDir + "Sample.pdf", Aspose.Cells.SaveFormat.Pdf); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize ExcelSaveOptions class object | |
ExcelSaveOptions options = new ExcelSaveOptions(); | |
// Set format as CSV | |
options.Format = ExcelSaveOptions.ExcelFormat.CSV; | |
// Load input PDF file | |
Document pdfDocument = new Document("Sample.pdf"); | |
// Save output CSV file | |
pdfDocument.Save("Sample.csv", options); |
Your referred blog is old and in newer versions of Aspose.PDF for .NET API, "ConversionEngine" does not exist in ExcelSaveOptions. That's why you are getting compile time errors. Please remove the relevant line of code as it is not needed anymore. Please try the (updated) code segment, I have used fully qualified naming when defining objects for your reference:
e.g.
Sample code:
// Initialize ExcelSaveOptions class object
Aspose.Pdf.ExcelSaveOptions options = new Aspose.Pdf.ExcelSaveOptions();
// Set format as CSV
options.Format = Aspose.Pdf.ExcelSaveOptions.ExcelFormat.CSV;
// Load input PDF file
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("Sample.pdf");
// Save output CSV file
pdfDocument.Save("Sample.csv", options);
Let us know if you still have any issue.
Should you have further queries or issue, we also encourage you to post in the dedicated forums.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i'm getting error here