1

I'm using jQuery Media Plugin to embedded PDF into a web page as listed in the following sample to ebmedded PDF files.
The problem is, if any download manager installed on client machine, it starts automatically downloading file rather than viewing it in web page which is not required.

I need to force viewing of PDF file in page. Is this can be achieved using Media plugin or any other plugins? or anyway which can be used within ASP.NET page and must be a cross browser solution.

[Edit]
* Converting PDF to images or using any flash viewer for embedding pdf is not preferred.
* Using Google Docs Viewer is not preferred.

Ahmed Atia
  • 17,848
  • 25
  • 91
  • 133

2 Answers2

1

There is another plug-in available for jQuery here: http://dev.funkynerd.com/projects/jquery-pdfdoc

It uses the PDF.js library to render PDFs in JavaScript.

Jamie Carl
  • 1,206
  • 14
  • 22
0

That sounds like overkill. The ideal way is to just use the <object> tag to embed a pdf file in your markup.

For examples read this: http://pdfobject.com/

and this: http://joliclic.free.fr/html/object-tag/en/object-application.html#pdf

NotMe
  • 87,343
  • 27
  • 171
  • 245
  • I tried PDFObject, it's the same issue. IDM (Internet Download Manager) starts automatically downloading file, which is not required. – Ahmed Atia May 06 '11 at 14:46
  • 1
    If only it were that simple; In my experience, IE doesn't embed PDFs in a web page when using the `` tag. (all other browsers seem to handle it fine, though) – Andrew Barber May 06 '11 at 14:46
  • @Andrew: agreed on this. Cross Browser functionality should be provided, so I cannot depended on tag. Also, another issue, that in some browsers, tag is captured by browser built-in download manager, which also is not required. – Ahmed Atia May 06 '11 at 14:52
  • 1
    @Ahmed - it's possible the problem is with the download manager; It may be set to inject itself *always* to handle certain types of files, no matter what. Such a setting would be impossible to defeat from the server. – Andrew Barber May 06 '11 at 14:56