问题
Is there is a way to convert HTML file to Excel using iText 7? If the iText doesn't support, what is the the best way to convert HTML file to Excel? Thanks
sample HTML code as below:
<h1>Test</h1>
<p>Hello World</p>
回答1:
As far as I know iText makes PDF files. You won't be able to produce Excel files with this. (The two kinds of files have very little in common.)
The best way to convert HTML to Excel can depend on a number of factors: you tagged this question with C#. Are you running on a server or are you trying to automate an instance of Excel? What framework are you using? Do you have access to a filesystem? .Net Core?
You can look at the Microsoft OpenXML library for one option to create Excel files, but in my experience it can be brittle and require a lot of troubleshooting to get started. But it doesn't need Excel installed or licensed.
来源:https://stackoverflow.com/questions/54602414/convert-html-to-excel-document-using-itext-c-sharp