It depends on the type of document. With movies, image files, and PDFs, you can set up a layout where the entire layout is filled with a single container field. Auto-resize anchors and anchor top, bottom, left and right edges to the edges of this layout window. A New Window Script step followed by Go to Layout can open this window and display the file in the container field. With the auto-size anchors set as described, you can resize this floating window and the container field will resize with it.
For PDF's make this an interactive window so that you can view the different pages of the PDF.
Am I able to set this up once, so that for any container that is clicked the contents will appear in the new window?
Or do I need to create a layout for each container and link each container field seperatly?
We have quite a few containers.
You should only need the one layout. The details will depend on how you have structured your tables and relationships. In some cases, you may just need to base this "viewer layout" on the same table as the layout or portal where you clicked to get the expanded view.
In other cases, you may want to use Set Field to set a global container field to the value of your selected container field and then you use the global container field on your "viewer" layout.
And in other cases, a match field used in a relationship might be updated so that the current record on the viewer table links to the record that stores the selected file in a container field.
From a portal, go to related records can specify the new layout and the window options all in one script step while bringing up the selected file in that new window.
I believe I followed 'phil's' instructions correctly. However, when I click on the field with the pdf file in it, the new layout opens in a new window but the pdf file remains as an icon.
Is there a command to actually open a file I need to insert into the script? I am running Filemaker Pro Advanced 11.0v4 so may not have the 'interactive window' option you refer to in your first response.
This is the only post I have been able to find that speaks to opening files in container fields without exporting - so glad for it!
I believe I followed 'phil's' instructions correctly.
Which set of my instructions? I listed 3 different ways to produce the same result.
If you can describe what you did in detail, I may be able to spot what needs to be done differently in order to get the results that you want.
but the pdf file remains as an icon.
Was the container field on this layout optimized for interactive content? (This is a setting on the inspector's data tabl.)
And this is only possible in FileMaker 12 or newer.
Since I don't have FM12 or newer yet, I may have to find a different method.
Mainly I am trying to simply view the document without saving/exporting.
Here is what I did:
1 new layout:
- created the new layout with auto-size as per your parameters (the locks are not suppressed).
for Specify Field I used the container field from the table where the pdf document is located.
2 container field (that contains the pdf file) in table:
I inserted the script you suggested to open window & then go to layout #1.
For #2 I was trying to follow your instructions: "you may just need to base this "viewer layout" on the same table as the layout or portal where you clicked to get the expanded view."
Yes, but my instructions assume that you are using FileMaker 12 or newer. This is not an option for older versions.
You may be able to use a web viewer with a URL that opens a file rather than a web site to view the PDF.
If you are using a Mac, I am told that Insert Picture can be used to insert a PDF into a container field and the first page becomes visible in the container field. (but only the first page and this does not work in windows.)
On the other hand, if you use insert file to insert the PDF file with "store a reference" specified when inserting it, a script can use Go to field with the "select/Perform" option selected to open the inserted file in your computer's default application for opening PDF files. Double clicking such a container field will also open the PDF in the OS system's default PDF app.
Just upgraded to filemaker pro 13 & having same issue which is new window opens in new layout but pdf file remains as an icon.
More details regarding the field setup:
original container field (called 'A Document') with the pdf in it, has a script trigger as follows:
A_Docs script reads:
New Window [Style: Document]
Go to Layout ["A_Docs" (Transactions)]
new layout (called "A_Docs") contains one field which is same as original container field (ie 'A Document') and has no script trigger.
I made the 'A Document' field in each layout interactive leaving the 'start playback..' box un-checked.
thanks for you help!
If you use Insert PDF to insert the PDF into a container that has been optimized for interactive use, it should not appear as an icon.
For existing records, you may need to run a script as a one time fix that exports the files and reinserts them using Insert PDF.
hi Phil, re-inserting the document worked!! thanks so much!!