[support] AJAX

Chris Miller cjm at tryx.org
Wed Oct 23 16:10:31 UTC 2013


> From: "Jamie Holly" <hovercrafter at earthlink.net>
> To: support at drupal.org
> Sent: Wednesday, October 23, 2013 8:50:42 AM
> Subject: Re: [support] AJAX

> A PDF is also static. The controls for the PDF doesn't come from code
> you put in, but rather from the mimetype handler on the user's
> browser and the associated viewer/plugin (ie - Adobe Reader,
> Chrome's PDF viewer, etc.). Same thing as clicking a link to an MP3
> and your browser's audio player opens, so long as your browser has a
> handler associated with the MP3 mime-type.

> What you are going to need is some browser method of displaying a PDF
> within the browser, like FlexPaper, so you control the viewing
> mechanism. That you can load into a Colorbox through regular inline
> DOM or an iFrame. Even then you still got extra work to do, either
> using FlexPaper's desktop publisher or server side (which means
> having a VPS or dedicated server so you can install the needed
> software).

> You can also load the PDF via an iFrame in Colorbox, meaning the
> native PDF viewer in the browser will take over. That would be the
> easiest route, but also the one with the least amount of control.

I may yet relent and use colorbox, but that would dispel much of the impetus to learn Drupal AJAX, which is something I really want to do right now because I think I need to. Of course, if there is ALWAYS another, easier way to do it, then why bother? The answer to that question is that I can't be sure there is always another easier way to do it until I know a few ways. So, onward... 

I claimed I was displaying an image to avoid this whole discussion, but this looks like it might also be informative, so I'm here to listen. Yes. I misspoke when I said the PDF was not "static". I meant the displaying an image was something the browser knew how to do very well but the PDF required more instruction and in this case that instruction takes the form of an <OBJECT> tag: 

<object data="test.pdf#pagemode=thumbs&view=fitH&scrollbar=0&toolbar=0&statusbar=0&messages=0&navpanes=0" type="application/pdf" width="100%" height="80%"> 
<p>It appears your browser is not configured to display PDF files. No worries, just <a href="test.pdf" target="_blank">download the PDF file.</a></p> 
</object> 

PDF also requires that the end-user have the necessary client/plug-in, which is a configuration problem as has been suggested, but not one I need to worry about -- yet. 

After I can do what I want with Drupal AJAX, then I will investigate colorbox and try to do the same thing or better. Then I'll use the easier of the two. Frankly, if colorbox will do it at all, I will probably go with it because I now plan to use colorbox for the Photo Album piece and it is always better if you can avoid multiple ways to do the same basic thing. Do one thing well. 

Chris. 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20131023/c955cbef/attachment-0001.html 


More information about the support mailing list