[英]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.