- Code: Select all
var workbook = new Workbook();
workbook.LoadFromFile("file.xlsx");
workbook.SaveToFile("file2.pdf", FileFormat.PDF);
But when I try to save into stream, I get Excel file in this stream:
- Code: Select all
var workbook = new Workbook();
workbook.LoadFromFile("file.xlsx");
using (var stream = new MemoryStream())
{
workbook.SaveToStream(stream, FileFormat.PDF);
stream.Seek(0, SeekOrigin.Begin);
File.WriteAllBytes("file3.pdf", stream.ToArray());
}
Why it's happening? How can I get PDF file from workbook in my stream?
Thank You