i try to convert test.xlsx to pdf
test.xlsx has only 1 sheet and 1 Cell with "Hello World"
I've saved the xlsx with office 2016
i use freespire.xls
this is what i do:
- Code: Select all
using Spire.Xls;
using System;
using System.IO;
namespace XLSXToPDFTest
{
class Program
{
static void Main(string[] args)
{
Workbook workbook = new Workbook();
// load Excel file
workbook.LoadFromFile("C:\\test\\test.xlsx, ExcelVersion.Version2010");
// convert to PDF file format
workbook.ConverterSetting.SheetFitToPage = true;
// save the file
workbook.SaveToFile("C:\\test\\test.pdf", FileFormat.PDF);
}
}
}
the error:
'xr2' ist ein nicht deklariertes Präfix. Zeile 1, Position 359.
bei System.Xml.XmlTextReaderImpl.Throw(Exception e)
bei System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
bei System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
bei System.Xml.XmlTextReaderImpl.AttributeNamespaceLookup()
bei System.Xml.XmlTextReaderImpl.ParseAttributes()
bei System.Xml.XmlTextReaderImpl.ParseElement()
bei System.Xml.XmlTextReaderImpl.ParseElementContent()
bei System.Xml.XmlTextReaderImpl.Read()
bei System.Xml.XmlTextReader.Read()
bei System.Xml.XmlTextReaderImpl.Skip()
bei System.Xml.XmlTextReader.Skip()
bei spr3195.13(XmlTextReader A_0)
bei spr718.16()
bei spr718.24()
bei spr2433.0(spr4329 A_0)
bei spr4329.0(Stream A_0, spr1796 A_1, Boolean A_2)
bei spr4329..ctor(Stream A_0, spr1796 A_1)
bei Spire.Xls.Core.Spreadsheet.XlsWorkbook.SaveToPdf(Stream stream, ConverterSetting convertSetting)
bei Spire.Xls.Core.Spreadsheet.XlsWorkbook.SaveToPdf(String fileName, ConverterSetting convertSetting)
thank you
Lupo