PdfViewer - does it only work in Chrome?

0
0

I’ve dropped a PdfViewer control into my app and I’m giving it a PDF file (generated with PDFSharp) as a memory stream.

When I browse with Chrome, everything works great.  When I browse with Edge or IE11, nothing appears; I haven’t tried any other browsers.

Is this expected behavior?  I actually can live with this if it’s known limitation – I’ll just need to force a download for unsupported browsers.

  • You must to post comments
1
0

I save the pdf to file and show it with pdfviewer.

  • Chrome works fine.
  • Edge can show the pdf but all the buttons of the pdfviewer like Print, Zoom is not visible.
  • IE11 does not show pdf at all.
  • You must to post comments
1
0

The pdfviewer works with all browsers. There are 4 options:

  • Auto: it uses whatever pdf viewer the browser wants to use. IE wants to use Adobe if installed, if not installed nothing shows. This is the standard behavior.
  • Google: Forces the viewer to use google docs viewer which is limited and may work differently in chrome.
  • Mozilla: Forces the viewer to use pdf.js, which is mozilla custom viewer.
  • Custom: Lets you specify the url of a custom pdf viewer, which is usually pdf.js copied locally.

Try http://demo.wisej.com/codeproject click on Media. The pdf viewer is mozilla and works in all browsers.

 

  • Tung Ngo
    Thank Luca, Setting ViewerType = Mozilla resolves my problem.
  • You must to post comments
0
0

Thanks for the info, Luca.  Indeed, setting the ViewerType property on the PdfViewer control improved the situation, but for some reason it still doesn’t work in Edge, although the demo site you referenced does.  I’m not concerned about that at the moment – I’ll come back to it at some point.

  • Luca (ITG)
    Look at the console with F12 to see if the problem is with where you are getting the pdf file from, it could be a CORS problem.
  • Carl Daniel
    The document is from a MemoryStream in the application – not sure how that manifests in the browser, but I’ll take a look at the F12 tools and see if they tell me anything interesting.
  • Carl Daniel
    Hmm. I’m not very familiar with the tools in Edge or Chrome, but in Chrome I can clearly see in the network monitor where Pdf.js downloaded the images for it’s buttons, download the content, etc. In Edge, I don’t see anything like that at all.
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.