This is a public Forum  publicRSS

Forum post

    Andychn
    Web viewing a pdf file from a container fieldAnswered
    Forum post posted November 13, 2008 by Andychn , last edited February 9, 2012
    683 Views, 10 Comments
    Title:
    Web viewing a pdf file from a container field
    Post:

    We're trying to use the container field to contain pdfs... then we would like to show these pdf files in the web viewer... we hear ya can do it... we can't get it to work.  Anybody got an example of what to specify in the web address?

    We think it's something like:

    "data:text/pdf, webviewerfun::containMe"

    It no work! :smileysad:

    Best Answer

    TS_Oz

    In that case, you would need to script the process to view the PDF in a web viewer.

     

    The process would be:

     

    Export the field contents to the Temporary Path location

    Point the web viewer at the file 

    Answer

     

    • TS_Oz

      This will work if the files are stored as a reference. Create the following calculation field:

       

      Substitute ( GetValue ( GetAsText ( webviewerfun::containMe ) ; 2 ); ["filemac:/"; "file://"] ; ["filewin:/"; "file://"])

       

      Use that field as the web address.

    • Andychn

      Thanks Dave.

      I kinda thought that was how it had too be.  This client's current app stores the entire pdf in the container... ah well.

    • TS_Oz

      In that case, you would need to script the process to view the PDF in a web viewer.

       

      The process would be:

       

      Export the field contents to the Temporary Path location

      Point the web viewer at the file 

    • acrobat

      My question is simpler. How would I create a script to access a pdf file in the container field of a stand alone desktop version of the database so it can be opened, annotated or otherwise changed, then re-saved in the new version to the same container field when done.

       

      Thanks for any help.

       

      -Rob (relative newcomer to Filemaker) 

    • PhilModJunk
      You never know what some clever developer might have in the form of a plug in, but without such a "widget", your user would need an application installed on their machine that permits editing a PDF. PDF's aren't really intended for such editing, but several apps such as Adobe Acrobat permit minor edits and markups. With such an app installed and the Operating System configured to automatically open PDF files with this application, double clicking the container field (if stored as reference) would open it for editing as you describe.
    • acrobat

      Thanks for the fast reply.  When I double click on the pdf document icon in the container field nothing happens.  I am using the generic Document Library that comes with Filemaker Pro 9.  Is there some script that needs to be added?  Is this different between Filemaker 9 and 10?  If the file opened in a pdf reader would it be changed and saved back to the container if I made changes in the file?  I imagine that would require some sort of script to send the file to a temporary location on the computer for editing after which there would be another script to return it to the database.. dose that track with your understanding?

       

      -Rob 

    • PhilModJunk

      It works if you insert the PDF using Insert File and select the store by reference option in the bottom of the dialog.

       

      If you use Insert File and do not choose this option, you have to use export field contents to open the file. This can be scripted and you can set up your container field to be that button so that clicking the field opens the PDF.

    • acrobat

      Thanks,

       

      I get the idea of scripting the export of the file to a temporary folder and opening it in the system software.

       

      Do you know of any way to finish the process?  That is, once I have read and/or modified the file to script the replacement of the original file in the container field with the edited file?  Can you think of any way to do that without having to press a separate script in the Filemaker record?  Optimally, I want this to be seamless; clicking on the file, reading it and modifying it (no matter what the format, pdf, word file, etc.) then returning it to the container when finished with it without having to remember to activate some other script in Filemaker.

       

      Thanks!

       

      -Rob 

    • acrobat

      One other issue,

       

      If I use the container to simply point to the file on the computer is there any way to have the container field show a real picture of the file like I can see in Mac OSX?  I'd like the images to show the real rendered first page of the pdf file if possible.  This is certainly possible in Mac OSX.. it would be great if it worked in Filemaker as well but I only seem to be able to get a generic picture to show.

       

      Thanks,

       

      -Rob 

    • PhilModJunk

      As far as saving changes, if you've stored by reference, you aren't storing the file in your container field anyway--just the file path to where it's stored. Thus, you simply close the document saving your changes back to your hard drive and that's taken care of.

       

      If you want to display page one of your PDF, you might want to try using a web viewer instead of a container field. See the following thread for a description of this technique:

       

      http://forum-en.filemaker.com/fm/board/message?board.id=FM-en-4&message.id=27340&query.id=40113#M27340