[英]third party tool to conver XML Excel spreadsheets into PDF
I'm using CarlosAg ExcelXmlWriter library which generates XML Excel spreadsheets 2003 (*.xml)我正在使用生成 XML Excel 电子表格 2003 (*.xml) 的 CarlosAg ExcelXmlWriter 库
I need to find coomercial or free tool just that converts this generated xml spreadsheet into PDF. I tried SautinSoft library but it didn't work with my desired extension (xml) it only works with xlsx or xls extesnions我需要找到商业或免费工具,将生成的 xml 电子表格转换为 PDF。我尝试了 SautinSoft 库,但它不适用于我想要的扩展名 (xml),它仅适用于 xlsx 或 xls 扩展
thanks guys in advance提前谢谢大家
Try Aspose.尝试 Aspose。
http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
You might also need the PDF component, not sure how they do it now.您可能还需要 PDF 组件,不确定他们现在是怎么做的。
Can you simply use some pdf printer to do it?你能简单地使用一些 pdf 打印机来做吗?
Try to use a free solution (EpPlus): https://github.com/EPPlusSoftware/EPPlus Or SpreadSheet https://spreadsheetlight.com/ An another way:尝试使用免费解决方案 (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.