View Full Version : DHTM Windows Widget does not works with PDF

04-09-2011, 10:14 PM
1) Script Title: DHTML Windows Widget

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem: the script seems to be working fine with simple text etc but not with PDF and other such files!

Any ideas please?

thanks in advance for your time and help

04-09-2011, 10:55 PM
HTML is the format supported on the web. Files like PDFs and other media are not directly supported by browsers. Most browsers download the pdf as a file so you can view it in an external program. Some (including the most common browsers) do have plugins available to view the PDF in the browser, but that's like the browser opening a PDF file (just like an external program), not something that can be embedded. With the right use of frames or iframes you might be able to use the plugin to display a PDF in a portion of a window, in SOME browsers, but it wouldn't be very reliable.

In short, there's no way to do this because that's not how the web works. There would be ways to change your plans and display the same information (using HTML instead of PDFs, for example), but not as you are currently approaching it.

(It's not a bad idea, but it's just not supported.)

04-10-2011, 07:54 AM
Thanks for your response (in addition many thanks for the nice script). As you said that PDF is not actually a web browser supported format but can be used with the plugins. This reminded me that I can use iFrame format in this dhtml window and IF plugin is available then web browser should automatically utilize the same and voila! it works now.

I have simply specified the second parameter as "iFrame" instead of "Ajax" and it is working fine.

Thanks once again

04-10-2011, 05:29 PM
Interesting. It makes sense that would work in some browsers (as I said above), but I'm not sure it would work in all of them that have some PDF capability. For example, mobile devices like the iPhone treat pdfs in a different way. I'd suggest having a backup direct link to the PDF in case something goes wrong. But I'm glad that it worked out.