Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

PDF Viewer

All examples are included with download of MBS FileMaker Plugin.

PDF Viewer.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
Value Lists0
Custom Functions0
Custom Menus24
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
PDF Viewer
7 fields defined, 1 record
PDF Viewer

Fields

Table Name: PDF Viewer - 7 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
PrimaryKeyNormal, TextAuto-Enter:
  • Context table: PDF Viewer
    Calculation: Get( UUID )
Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestampNormal, TimestampAuto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                  CreatedByNormal, TextAuto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Not empty
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                  Account name of the user who created each record
                          ModificationTimestampNormal, TimestampAuto-Enter:
                          • Modification timestamp
                          Validation:
                          • Only during data entry
                          • Strict data type: 4 digit year
                          • Not empty
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                          Date and time each record was last modified
                                  ModifiedByNormal, TextAuto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Not empty
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                  Account name of the user who last modified each record
                                          PDF ContainerNormal, BinaryAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                              PDF PathNormal, TextAuto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German

                                                  Layout Objects: PDF Viewer

                                                  Regular Fields

                                                  Field Name: PDF Viewer::PDF Container
                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                  • Top: 60 pt
                                                  • Left: 138 pt
                                                  • Bottom: 334 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  No

                                                  Field Name: PDF Viewer::PDF Path
                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                  • Top: 376 pt
                                                  • Left: 138 pt
                                                  • Bottom: 407 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Buttons

                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Select PDF
                                                  • Top: 418 pt
                                                  • Left: 276 pt
                                                  • Bottom: 449 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Select PDF” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Import PDF
                                                  • Top: 334 pt
                                                  • Left: 276 pt
                                                  • Bottom: 365 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Import PDF” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Show Preview
                                                  • Top: 536 pt
                                                  • Left: 251 pt
                                                  • Bottom: 567 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Show Preview” ]

                                                  Scripts:


                                                  Script Hierarchy

                                                  Import PDF
                                                  Select PDF
                                                  Show Preview
                                                  Close Preview
                                                  Clear

                                                  Next Script: [Select PDF]
                                                  Script NameImport PDF
                                                  Run script with full access privilegesOff
                                                  Include In MenuYes
                                                  Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • Go to Layout [ original layout ]
                                                    • Set Error Capture [ On ]
                                                    • #create record if missing
                                                    • If [ Get(FoundCount) = 0 ]
                                                    • New Record/Request
                                                    • End If
                                                    • Go to Field [ PDF Viewer::PDF Container ] [ Select/perform ]
                                                    • Insert PDF [ ]
                                                    • If [ Get(LastError) = 3 ]
                                                    • Insert File [ PDF Viewer::PDF Container ] [ Filters ] [ "PDF": ( *.pdf ) ] [ Storage method: Insert ] [ Display content ] [ Compression: Never compress ]
                                                    • End If
                                                    • #on success, clear PDF path
                                                    • If [ Get(LastError) = 0 ]
                                                    • Set Field [ PDF Viewer::PDF Path; "" ]
                                                    • End If
                                                    Fields used in this script
                                                    Scripts used in this script
                                                      Layouts used in this script
                                                        Tables used in this script
                                                        Table occurrences used by this script
                                                        Custom Functions used by this script
                                                          Custom menu set used by this script

                                                            Previous Script: [Import PDF]Next Script: [Show Preview]
                                                            Script NameSelect PDF
                                                            Run script with full access privilegesOff
                                                            Include In MenuYes
                                                            Layouts that use this script
                                                            Scripts that use this script
                                                              Script Definition
                                                              Script Steps
                                                              • Go to Layout [ original layout ]
                                                              • Set Error Capture [ On ]
                                                              • #create record if missing
                                                              • If [ Get(FoundCount) = 0 ]
                                                              • New Record/Request
                                                              • End If
                                                              • #show file dialog
                                                              • Set Variable [ $r; Value:MBS("FileDialog.Reset") ]
                                                              • Set Variable [ $r; Value:MBS("FileDialog.SetAllowMulti"; 0) ]
                                                              • Set Variable [ $r; Value:MBS("FileDialog.SetFilter"; "com.adobe.pdf"; "*.PDF"; "PDF files") ]
                                                              • Set Variable [ $r; Value:MBS("FileDialog.OpenFileDialog") ]
                                                              • If [ $r = "OK" ]
                                                              • #save path
                                                              • Set Variable [ $path; Value:MBS("FileDialog.GetPath"; 0) ]
                                                              • If [ MBS("IsError") = 0 ]
                                                              • #store path and clear container
                                                              • Set Field [ PDF Viewer::PDF Path; $path ]
                                                              • Set Field [ PDF Viewer::PDF Container; "" ]
                                                              • Commit Records/Requests [ No dialog ]
                                                              • End If
                                                              • End If
                                                              Fields used in this script
                                                              Scripts used in this script
                                                                Layouts used in this script
                                                                  Tables used in this script
                                                                  Table occurrences used by this script
                                                                  Custom Functions used by this script
                                                                    Custom menu set used by this script

                                                                      Previous Script: [Select PDF]Next Script: [Close Preview]
                                                                      Script NameShow Preview
                                                                      Run script with full access privilegesOff
                                                                      Include In MenuYes
                                                                      Layouts that use this script
                                                                      Scripts that use this script
                                                                        Script Definition
                                                                        Script Steps
                                                                        • Perform Script [ “Close Preview” ]
                                                                        • If [ IsEmpty ( PDF Viewer::PDF Container ) and IsEmpty ( PDF Viewer::PDF Path ) ]
                                                                        • Show Custom Dialog [ Title: "No PDF?"; Message: "Please select or import a PDF first."; Default Button: “OK”, Commit: “Yes” ]
                                                                        • Exit Script [ ]
                                                                        • End If
                                                                        • #let FileMaker draw layout
                                                                        • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                                        • #now add control
                                                                        • Set Variable [ $$preview; Value:MBS( "Preview.CreateWithControl"; 0; "placeholder") ]
                                                                        • If [ MBS("IsError") ]
                                                                        • Show Custom Dialog [ Title: "Failed to create preview control"; Message: $$preview; Default Button: “OK”, Commit: “Yes” ]
                                                                        • Set Variable [ $$preview; Value:"" ]
                                                                        • End If
                                                                        • #load content
                                                                        • If [ not IsEmpty ( PDF Viewer::PDF Container ) ]
                                                                        • Set Variable [ $r; Value:MBS( "Preview.LoadContainer"; $$preview; PDF Viewer::PDF Container ) ]
                                                                        • If [ MBS("IsError") ]
                                                                        • Show Custom Dialog [ Title: "Failed to load container"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                        • End If
                                                                        • Else If [ not IsEmpty ( PDF Viewer::PDF Path ) ]
                                                                        • Set Variable [ $r; Value:MBS( "Preview.LoadFile"; $$preview; PDF Viewer::PDF Path ) ]
                                                                        • If [ MBS("IsError") ]
                                                                        • Show Custom Dialog [ Title: "Failed to load file"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                        • End If
                                                                        • End If
                                                                        Fields used in this script
                                                                        Scripts used in this script
                                                                        Layouts used in this script
                                                                          Tables used in this script
                                                                          Table occurrences used by this script
                                                                          Custom Functions used by this script
                                                                            Custom menu set used by this script

                                                                              Previous Script: [Show Preview]Next Script: [Clear]
                                                                              Script NameClose Preview
                                                                              Run script with full access privilegesOff
                                                                              Include In MenuYes
                                                                              Layouts that use this script
                                                                                Scripts that use this script
                                                                                Script Definition
                                                                                Script Steps
                                                                                • If [ $$preview ]
                                                                                • Set Variable [ $r; Value:MBS( "Preview.Release"; $$preview ) ]
                                                                                • Set Variable [ $$preview; Value:"" ]
                                                                                • End If
                                                                                Fields used in this script
                                                                                  Scripts used in this script
                                                                                    Layouts used in this script
                                                                                      Tables used in this script
                                                                                        Table occurrences used by this script
                                                                                          Custom Functions used by this script
                                                                                            Custom menu set used by this script

                                                                                              Previous Script: [Close Preview]
                                                                                              Script NameClear
                                                                                              Run script with full access privilegesOff
                                                                                              Include In MenuYes
                                                                                              Layouts that use this script
                                                                                                Scripts that use this script
                                                                                                  Script Definition
                                                                                                  Script Steps
                                                                                                  • Perform Script [ “Close Preview” ]
                                                                                                  • Set Field [ PDF Viewer::PDF Path; "" ]
                                                                                                  • Set Field [ PDF Viewer::PDF Container; "" ]
                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                  Fields used in this script
                                                                                                  Scripts used in this script
                                                                                                  Layouts used in this script
                                                                                                    Tables used in this script
                                                                                                    Table occurrences used by this script
                                                                                                    Custom Functions used by this script
                                                                                                      Custom menu set used by this script

                                                                                                        Download example: PDF Viewer

                                                                                                        Used functions: