简体   繁体   中英

third party tool to conver XML Excel spreadsheets into PDF

I'm using CarlosAg ExcelXmlWriter library which generates XML Excel spreadsheets 2003 (*.xml)

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

thanks guys in advance

Try Aspose.

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.

Can you simply use some pdf printer to do it?

Try to use a free solution (EpPlus): https://github.com/EPPlusSoftware/EPPlus Or SpreadSheet https://spreadsheetlight.com/ An another way:

  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 });
            }
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM