6 Replies Latest reply on Apr 3, 2014 8:32 AM by philmodjunk

    viewing hyperlinked pdf not possible ?

    peloca

      Title

      viewing hyperlinked pdf not possible ?

      Post

           Inserting a hyperlink seems rather basic and very useful functionality. Most document generating software packages support this. How much I was surprised that this is not at all supported by  Filemaker PRO 12. At least not under Windows.

           After looking through this forum I found a useful workaround  using the Export field content function in a script. This works perfectly at first glance but it involves a temporary file to be written. This file is being written as a read only file. So the second time I want to view my PDF I get an error because the same temporary file cannot be overwritten. 

           Does any one have a solution?

            

            

            

            

      Untitled.png

        • 1. Re: viewing hyperlinked pdf not possible ?
          philmodjunk

               Are you exporting this to the temporary items folder? You can use a calculation that appends a timestamp to your file name to export to a unique file name each time.

               Also, you can set up a hyperlink on a text field containing the filepath to a PDF file if you use Open URL to open the file and if you use Insert File to insert the file with the "store a reference" option selected, you can double click a non-interactive, non externally stored container field to open the file referenced in the container field.

          • 2. Re: viewing hyperlinked pdf not possible ?
            davidanders

                 There are many plugins that provide capabilities not found in Filemaker. (one or two are free)

                 http://filemaker-plugins.com/features/file-manipulation/

            • 3. Re: viewing hyperlinked pdf not possible ?
              peloca

                   Thanks PhilModJunk for your answer. I tried your idea to use a text field for the hyperlink, but did not succeed. The first problem is that I do not know how to make script that opens  a windows file dialog and then produce a string pointing to a file to go into the text field.

                   The Container field is intended for this purpose but doesn't work. When optimised for interactive content  it produces a dialog about downloading a file (??) and saving a file ??? while the file is already there. I still hope I will find a solution because the database I worked on so long is useless if I am not able to link to .pdf files

                   .

                    

                    

                    

              • 4. Re: viewing hyperlinked pdf not possible ?
                philmodjunk

                     I suggest that you describe what you are trying to do in more detail.

                     What storage options did you specify for this container field?

                     When you get the above dialog, where you using FIleMaker or WebDirect?

                     What did you do immediately prior to getting this dialog?

                     

                          The first problem is that I do not know how to make script that opens  a windows file dialog and then produce a string pointing to a file to go into the text field.

                     You can use Insert File in a script to insert a file "by reference" into a container field. (Does not need to be optimized for interactive content.) Your script can then extract the file path from this container field to put that file path into a string.

                     But you may also find it useful to just put that non-interactive container field on your layout. With Insert File used to insert the file with the "store a reference" option selected, double clicking the container field will open it in your systems default application for opening PDF files.

                • 5. Re: viewing hyperlinked pdf not possible ?
                  peloca

                       Dear PhilmodJunk,

                       First off all I would like to thank you for your support.

                       I have now two tracks to solve this problem: the container field and the text field that you suggested.

                       The container field seems a bit less complicated.  I can get exactly the behavior that I want except when the linked file is a read-only file. I found that FM (Export function) copies the read-only attributes into the temporary file which leads to problems. But I could  live with that, I just have to take care not to hyperlink to read-only files. 

                       The storage options I choose in the database do not really make much difference.  The strange unwanted dialogs seem only to be related to choosing  optimize for Interactive Content (PDF, MP3, etc) .These dialogs pop up when I right click on the field and choose "Insert PDF" but also when I just step through the record and arrive on a record where this container field is still empty. 

                       Using a textfield did not get me any results yet.  I have tried to copy the link into a text field using an intermediate container field using the function GetAsText ( testlink::pdflink).  This produces a long string like: "file:BSH103.pdf filewin:/G:/projecten/testlink/BSH103.pdf" or "image:BS170.pdf imagewin:/D:/datasheet/BS170.pdf" .

                       Regards,

                       peloca

                        

                        

                        

                        

                        

                        

                        

                  • 6. Re: viewing hyperlinked pdf not possible ?
                    philmodjunk
                         

                              The strange unwanted dialogs seem only to be related to choosing  optimize for Interactive Content (PDF, MP3, etc) .These dialogs pop up when I right click on the field and choose "Insert PDF" but also when I just step through the record and arrive on a record where this container field is still empty.

                         That's interesting. Note how the dialogs are similar/identical to the dialogs you can get when using your web browser to open/download a PDF file. I've learned from TSGal that an interactive container field is actually a customized web viewer instead of just a container field. I don't know if you are getting this due to issues with the particular "web kit" code that FileMaker's Web Viewer uses (code that is a subset of Safari on Macs and Internet Explorer on windows and is supplied by the publishers of those browsers) or not, but you might investigate what adobe add ons or "plug ins" you have selected for one of those web browsers. And it's a long shot, but you might also see if you have an option set on that browser that asks for a download location before downloading or opening a PDF.

                         And you might report this as a possible bug in Report an Issue to see what the FileMaker Techs might have to suggest on this issue. But before you do, let's focus on this statement: "but also when I just step through the record and arrive on a record where this container field is still empty." Try removing the container field from the tab order so that arriving at a record has no chance of automatically putting the focus on this field. (Enter layout mode and select Set Tab Order... from the Layouts menu) Do you still get these dialogs?

                         

                              Using a textfield did not get me any results yet.  I have tried to copy the link into a text field using an intermediate container field using the function GetAsText ( testlink::pdflink).  This produces a long string like: "file:BSH103.pdf filewin:/G:/projecten/testlink/BSH103.pdf" or "image:BS170.pdf imagewin:/D:/datasheet/BS170.pdf" .

                         You are getting close and apologies for not spelling out more of the details earlier, but the file path you can get from a container field isn't in exactly the right format for Open URL to use. GetValue ( ContainerFieldHere ; 2 ) will extract the file path of a file inserted via Insert File with the "store a reference" option selected. But this file path will then need a bit of "surgery" to get it into the format that Open URL works.

                         Here's an experiment that can help you explore the differences in order to figure out a calculation that takes the filepath from the container and produces a filepath that Open URL can use:

                         Launch a Web Browser such as FireFox. Use Open | File to open the PDF file. Copy the text from the URL box at the top of the browser and paste this text somewhere for reference. This is exactly the text you need in the text field for Open URL to work. (At least it works that way for me in Windows...)

                         Now compare that text to what is returned by GetValue ( ContainerField ; 2 ). You should see that most of the text is identical except that the text at the very beginning needs to be modified slightly to get the same text you saw in the URL box in your Browser.

                         One final comment on using a container field as your hyperlink: Put a container field on your layout. Do NOT format it as an interactive container field. Use Insert File to insert a PDF with "store a reference" selected. Now double click the container field. You should see the PDF open in Adobe or whatever application your OS specifies as the Default application (might be "preview" on a Mac) for opening PDF files. There's no need to specify Interactive optimization unless you plan on viewing the PDF inside the container field.