用于将 XML Excel 电子表格转换为 PDF 的第三方工具
本文关键字:PDF 第三方 工具 转换 XML Excel 电子表格 用于 | 更新日期: 2023-09-27 18:30:48
我正在使用 CarlosAg ExcelXmlWriter 库,该库生成 XML Excel 电子表格 2003 (*.xml)
我需要找到将生成的xml电子表格转换为coomercial或免费工具.PDF。我尝试了SautinSoft库,但它不适用于我想要的扩展(xml),它仅适用于xlsx或xls extesnions
提前感谢大家
试试Aspose。
http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
您可能还需要PDF组件,但不确定他们现在如何做到这一点。
你能简单地使用一些pdf打印机来做到这一点吗?
尝试使用免费解决方案(EpPlus):https://github.com/EPPlusSoftware/EPPlus或电子表格 https://spreadsheetlight.com/另一种方式:
static void ConvertFromStream()
{
// The conversion process will be done completely in memory.
string inpFile = @"..'..'..'example.xml";
string outFile = @"ResultStream.pdf";
byte[] inpData = File.ReadAllBytes(inpFile);
byte[] outData = null;
using (MemoryStream msInp = new MemoryStream(inpData))
{
// Load a document.
DocumentCore dc = DocumentCore.Load(msInp, new XMLLoadOptions());
// Save the document to PDF format.
using (MemoryStream outMs = new MemoryStream())
{
dc.Save(outMs, new PdfSaveOptions() );
outData = outMs.ToArray();
}
// Show the result for demonstration purposes.
if (outData != null)
{
File.WriteAllBytes(outFile, outData);
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(outFile) { UseShellExecute = true });
}
}