dantee_87
dantee_87

Reputation: 71

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

Upvotes: -1

Views: 358

Answers (3)

Rickie
Rickie

Reputation: 11

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

Upvotes: 0

Remy
Remy

Reputation: 12713

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.

Upvotes: 1

Mingliang
Mingliang

Reputation: 79

Can you simply use some pdf printer to do it?

Upvotes: 0

Related Questions