3 Replies Latest reply on Oct 2, 2012 2:17 AM by Test Screen Name

    Pdf files and mobile devices

    3dsolutions

      I have seen this code in a webpage

       

      <script type="text/javascript">

              /*DETECTAR SI ES DISPOSITIVO MOVIL Y REDIRECCIONAR A zzz*/

              $(document).ready(function (){

                  var mobile = (/iphone|ipod|android|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));

                  if(mobile){

      window.location.href="/Microsites/fusion/m/zzz.html";

                  }

              });

              /*FIN DETECTAR SI ES DISPOSITIVO MOVIL Y REDIRECCIONAR A zzz*/

      </script>

       

      The code redirects to a webpage (zzz.html) if the user is reading the website in a mobile device.

       

      Can this code be apply to a pdf file ?

      Instead to redirect to a website,  window.location.href="/Microsites/fusion/m/zzz.html";

      what will be the code to open a message saying " this pdf file can not be read correctly in a mobile device" ?

       

      This will be very usefull specially in documents with Rich Media Annotations.

       

      Thanks in advance.

        • 1. Re: Pdf files and mobile devices
          gkaiseril MVP & Adobe Community Professional

          But PDF files are read by mobile devices when the appropriate app has been installed. Because mobile devices not not have all the resources of a computer some items like JavaScript do not work. From using my Nook Color eReader, Asus tablet and Samsung phone, PDFs are downloaded to the device and then opened with a PDF reading app not within a web browser.

           

          This forum is for Acrobat JavaScript in Acrobat forms, Actions, or Batch Processing.

          • 2. Re: Pdf files and mobile devices
            3dsolutions Level 1

            HI Gkaiseril,

             

            thanks for your answer. I did not know that javascript can not be read by mobile devices.

             

            I guess there must be some other way to tell a mobile device that Rich Media is not available.

            • 3. Re: Pdf files and mobile devices
              Test Screen Name Most Valuable Participant

              Consider a PDF with a big button that says "This PDF cannot be read on this device, or with this software, or you need to turn on JavaScript in Adobe Reader".

               

              (Recall that people may use PDF Readers without rich media support on a PC or Mac; and that they may have Adobe Reader with JavaScript switched off).

               

              Then you use JavaScript to hide the button.