We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ExcelToPdf

Hello!

I'm using ExcelToPdfConverter  to convert Excel file (with a lot of data) to Pdf. I'm convert it from stream.

Problem is converter pasted whole Excel file onto one page Pdf and it's not readable. After converting I'm printing it.

I tried your's example and it doesn't help me:  http://asp.syncfusion.com/demos/web/pdf/exceltopdf.aspx

It's my code:


using (MemoryStream streamToPdf = new MemoryStream())

{

streamToPdf.Write(memArray, 0, memArray.Length);

streamToPdf.Position = 0;


ExcelToPdfConverter converter = new ExcelToPdfConverter(streamToPdf);

PdfDocument pdfDocument = new PdfDocument();

ExcelToPdfConverterSettings settings = new ExcelToPdfConverterSettings();

settings.LayoutOptions = LayoutOptions.FitAllColumnsOnOnePage;

settings.TemplateDocument = pdfDocument;

settings.DisplayGridLines = GridLinesDisplayStyle.Invisible;


pdfDocument = converter.Convert(settings);

string pathtoPdf = HttpContext.Current.Server.MapPath("~/ReportTemplate/Report.pdf");

pdfDocument.Save(pathtoPdf);


return pathtoPdf;

}


Thanks for any help!


2 Replies

AS Artem Shabalinsky September 7, 2015 04:30 PM UTC

Hello, Again!
it was my fault!
everything work fine!
Thanks!


MM Mathu Mohan Vijayakumar Syncfusion Team September 8, 2015 12:04 PM UTC

Hi Artem,

We are glad to know that the issue has been resolved at your end. Please let me know if you have any other queries, we will be happy to assist you.

Regards,
V.A.Mathu Mohan


Loader.
Live Chat Icon For mobile
Up arrow icon