2

Please can someone advise how I can display a PDF in a WebBrowser Control.

The PDF is generated by exporting a Crystal ReportClass to stream using:

receiptStream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

I have been trying to open this in a WebBrowser Control using DocumentStream = receiptStream but this just produces a page of rubbish.

I would prefer not to have to export the stream to file in order to display as this PDF is for transactional receipts, so this would be a large resource requirement.

Any help would be greatly apreciated.

Richard Gale
  • 1,816
  • 5
  • 28
  • 45
  • You may want to try the [Data URI approach](http://stackoverflow.com/a/19288403/1768303). It did not work for IE10 last time I tried though. – noseratio Jun 30 '14 at 20:44
  • Hi, Thanks for the suggestion. With mine being a WinForms app, will this be affected by IE10 or does the webbrowser control pick up on the default browser? – Richard Gale Jul 01 '14 at 08:05
  • It actually defaults to IE7 emulation, you'd need to use ` `, ``, and implement browser feature control: http://stackoverflow.com/a/18333982/1768303. Then it will use the latest and greatest features of whatever IE version is installed on the user's PC. – noseratio Jul 01 '14 at 08:36
  • possible duplicate of [Display PDF from a stream in a WebBrowser control](http://stackoverflow.com/q/3038043/11683) – GSerg Jan 23 '16 at 11:01

0 Answers0