Page 1 of 1

Direct display in browser of a PDF file

Posted: Mon Feb 20, 2017 4:52 pm
by lfcapacio
Into the manual have a example to export to PDF:

Code: Select all

var report = new Stimulsoft.Report.StiReport();
report.loadFile("SimpleList.mrt");
report.render();

var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();

var service = new Stimulsoft.Report.Export.StiPdfExportService();

var stream = new Stimulsoft.System.IO.MemoryStream();

service.exportTo(report, stream, settings);

var data = stream.toArray();
Object.saveAs(data, "SimpleList.pdf", "application/pdf");
But i need that the browser display the pdf file and don't display the dialog to save a file.

It's possible ?

Thank you for atention.

Re: Direct display in browser of a PDF file

Posted: Tue Feb 21, 2017 10:57 am
by HighAley
Hello.

Unfortunately, there is no universal solution.
You could try t use next method:

Code: Select all

URL.createObjectURL(pdfBytes);
You could find more solutions here.

Thank you.