Computing.Net > Forums > Web Development > Get, show PDF, JPG, Video

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Get, show PDF, JPG, Video

Reply to Message Icon

Name: Michel777
Date: November 5, 2009 at 02:12:30 Pacific
OS: Windows Vista
Subcategory: Javascript/Ajax
Comment:

Hi Forum,

we want show some pages, documents on by on in fullscreen, without any user interaction.
This is a kind of digital signage application.

All of them are accesable via http:

1) http://.....any1.html
2) http://.....any2.pdf
3) http://.....any3.jpg
4) http://.... any4.mp4


We have no problems with 1). But what about the rest ?
How insert the contents to be able later rotat over them ?

Thanks in advance,

Michel



Sponsored Link
Ads by Google

Response Number 1
Name: Night
Date: November 10, 2009 at 04:06:39 Pacific
Reply:

None of the sites work.

Asus M4A78-EM
AMD Phenom II X2 550 @ 3.11
Patriot PC2-6400 4Gig
MSI R4830
Seagate 160Gig SATA
Seagate 320Gig SATA
External 1T


1

Response Number 2
Name: Michel777
Date: November 10, 2009 at 08:18:57 Pacific
Reply:

no wonder, there are only examples. The question is, how to inject the documents into the DOM. It seems, that we need iframes (2,4)


0

Response Number 3
Name: shutat
Date: November 10, 2009 at 21:18:07 Pacific
Reply:

I'm not quite sure what you're asking, so this may be way off base. If you can use javascript, then maybe something like below can be used.

Substitude whatever code you'd use for each of the four options in the innerHTML property. Of course, the user would need to have js enabled.

<script type="text/javascript">

var cycle = 1;
var htm = "htm";
var pdf = "pdf";
var jpg = "jpg";
var mp4 = "mp4";

function rotate() {   

   createEl(cycle);

   if(cycle == 1) {
      cycle = 2;
   } else if(cycle == 2) {
      cycle = 3;
   } else if(cycle == 3) {
      cycle = 4;
   } else {
      cycle = 1;
   }
}

function createEl(mode) {   

   if(document.getElementById("dynEle") == null || 
      document.getElementById("dynEle") == undefined) {

      try {

         var d = document.createElement("div");

         d.id = "dynEle";
         d.style.position = "absolute"; // relative
         d.style.top    =  "10px"; // can be in switch
         d.style.left   =  "10px"; // can be in switch
         d.style.width  = "100px"; // can be in switch
         d.style.height = "100px"; // can be in switch             

         switch(mode) {

            case 1 : d.style.backgroundColor = "#ffff00";
                     d.innerHTML = htm; break;
            case 2 : d.style.backgroundColor = "#00ffff";
                     d.innerHTML = pdf; break;
            case 3 : d.style.backgroundColor = "#ff00ff";
                     d.innerHTML = jpg; break;
            case 4 : d.style.backgroundColor = "#9999ff";
                     d.innerHTML = mp4; break;
        }

        document.body.appendChild(d);
        delete(d);
      } catch(e) { alert('Error creating element' + '\n' + e.message); }

   } else {

      try {
         if(document.getElementById("dynEle") != null &&
            document.getElementById("dynEle") != undefined) {
            document.body.removeChild(document.getElementById("dynEle"));

         createEl(mode);
 
         }
      } catch(e) { alert('Error removing element' + '\n' + e.message); }
   }

   return;
} 

</script>

<body onload="setInterval('rotate()', 3000)">

HTH


1

Response Number 4
Name: Michel777
Date: November 11, 2009 at 00:01:02 Pacific
Reply:

Hi shutat,

that is more then I expected. I had diffculties with injection of pdf . I will try your cod.

Thanks for your effort.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Get, show PDF, JPG, Video

pdf files in Tomcat (on linux) www.computing.net/answers/webdevel/pdf-files-in-tomcat-on-linux/2620.html

Novice seeking basic advise please www.computing.net/answers/webdevel/novice-seeking-basic-advise-please/358.html

cant access webpage outside lan ..? www.computing.net/answers/webdevel/cant-access-webpage-outside-lan-/3045.html