2 Replies Latest reply on Feb 18, 2016 1:00 PM by msawyer

    Opening a PDF in FM Go 14

    msawyer

      On FM Go I want users t be able to open the PDF displayed in a container. The container displays the PDF but you can only see the first page.

       

      Process works if I am on GO and within the network.

       

      Outside of network I get  a failed to open message I have attached a screenshot.

       

      Works on

       

      Scripts is as follows:

      Case(

      Abs(Get ( SystemPlatform ))=2;

      "filewin:"&Get ( TemporaryPath )&GetContainerAttribute ( IOS_Job_Images::con_Image;"filename")

      ;

      Abs(Get ( SystemPlatform ))=1;

      "filemac:"&Get ( TemporaryPath )&GetContainerAttribute ( IOS_Job_Images::con_Image;"filename")

      ;

      Abs(Get ( SystemPlatform ))=3;

      "file:"&Get ( DocumentsPath )&GetContainerAttribute ( IOS_Job_Images::con_Image;"filename")

      ;

      "remote:"&GetContainerAttribute ( IOS_Job_Images::con_Image;"filename")

      )

       

      Note works in FileMaker 14 outside network.

       

      Any thoughts

        • 1. Re: Opening a PDF in FM Go 14
          TSGal

          msawyer:

           

          Thank you for your post.

           

          I am unable to replicate the issue.  However, I don't see your entire script, so here is the script I used instead:

           

          Set Variable [ $path ; Value: Get (TemporaryPath) & GetContainerAttribute ( <Container field> ; "filename") ]

          Set Variable [ $platform  ; Value: Abs ( Get ( SystemPlatform ) ) ]

          Set Variable [ $filepath ; Value:  Case ($plat = 1 ; "filemac:" ; $plat = 2 ; "filewiin:" ; "file:") & $path

          Export Field Contents [ <Container field> ; "$filepath" ]

          Set Variable [ $url ; Value: Substitute ( $path ; " " ; "%20" ) ]

          Open URL [ "file:/" & $url ]

           

          The above steps could be condensed, but I separated them out for readability.  Here is a description.

           

          In the first step, I set up the Temporary path.  This also works for FileMaker Go.

          In the second step, I am simply getting the SystemPlatform.  I could have easily used a Let statement.

          In the third step, I used the platform to determine Mac, Windows, or other.

          In the fourth step, the Container field is exported to the temporary $filepath

          In the fifth step, since I want to open this in a browser, I substituted the spaces for %20.

          In the sixth step, I open the file in the temporary folder.

           

          This worked for LAN and WAN, since the file is downloaded to the temporary directory of the client.

           

          Let me know if you have any questions.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Opening a PDF in FM Go 14
            msawyer

            Hi

             

            Thanks very much, that works perfectly.

             

            Regards

             

            Matt

            **********************************************

            Matt Sawyer

            Information for Business

            Mobile: +61418 160059 Office: 61 2 9328 2492