[英]third party tool to conver XML Excel spreadsheets into PDF
我正在使用生成 XML Excel 电子表格 2003 (*.xml) 的 CarlosAg ExcelXmlWriter 库
我需要找到商业或免费工具,将生成的 xml 电子表格转换为 PDF。我尝试了 SautinSoft 库,但它不适用于我想要的扩展名 (xml),它仅适用于 xlsx 或 xls 扩展
提前谢谢大家
尝试 Aspose。
http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
您可能还需要 PDF 组件,不确定他们现在是怎么做的。
你能简单地使用一些 pdf 打印机来做吗?
尝试使用免费解决方案 (EpPlus): https://github.com/EPPlusSoftware/EPPlus或 SpreadSheet 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 });
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.