Converet Excel to PDF : invalid character

Hello,

I am trying to convert a simple excel file to PDF using the latest version that I downloaded today

I am getting the follwoing error

There is an invalid character in the given encoding. Line 1, position 1

The error comes at

xmlDoc.Load(stream)

Dim stream As MemoryStream = New MemoryStream

workbook = New Workbook

workbook.Open( strInputFilename)

doc.Save(stream, SaveFormat.AsposePdf)

stream.Seek(0, SeekOrigin.Begin)

Dim xmlDoc As XmlDocument = New XmlDocument

xmlDoc.Load(stream)

Dim pdf As Aspose.PDF.Pdf = New Aspose.PDF.Pdf

pdf.IsImagesInXmlDeleteNeeded = True

pdf.BindXML(xmlDoc, Nothing)

pdf.IsTruetypeFontMapCached = False

pdf.Save(strOutputFilename)

I tried your file and it worked fine.

MemoryStream stream = new MemoryStream();

Workbook excel = new Workbook();
excel.Open("d:\\test\\book1.xls");

excel.Save(stream, FileFormatType.AsposePdf);

stream.Seek(0, SeekOrigin.Begin);

Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(stream);

pdf1.BindXML(xmlDoc, null);

pdf1.Save("d:\\test\\abc.pdf");

Attached is the output file.

Could you please create a simple console application to see if my code works?

I tried your code and it worked

Thanks