MBS FileMaker Plugin Example Databases

DynaPDF Test

All examples are included with download of MBS FileMaker Plugin.

DynaPDF Test.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts10
Value Lists0
Custom Functions0
Custom Menus32
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
Test
6 fields defined, 2 records
Test

Fields

Table Name: Test - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
dataNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      PageIndexNormal, NumberAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          PageCountNormal, NumberAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              PageImageNormal, BinaryAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
                  PageTextNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      PageStatsNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German

                          Layout Objects: Test

                          Regular Fields

                          Field Name: Test::data
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 60 pt
                          • Left: 72 pt
                          • Bottom: 203 pt
                          • Right: 553 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: Test::PageIndex
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 204 pt
                          • Left: 72 pt
                          • Bottom: 218 pt
                          • Right: 220 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Field Name: Test::PageCount
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 222 pt
                          • Left: 72 pt
                          • Bottom: 236 pt
                          • Right: 220 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Field Name: Test::PageImage
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 240 pt
                          • Left: 72 pt
                          • Bottom: 707 pt
                          • Right: 553 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: Test::PageText
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 444 pt
                          • Left: 618 pt
                          • Bottom: 704 pt
                          • Right: 1099 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Field Name: Test::PageStats
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 240 pt
                          • Left: 636 pt
                          • Bottom: 434 pt
                          • Right: 1027 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          Yes

                          Group Buttons

                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page count
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 12 pt
                          • Left: 72 pt
                          • Bottom: 31 pt
                          • Right: 187 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageCount” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page image
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 12 pt
                          • Left: 192 pt
                          • Bottom: 31 pt
                          • Right: 307 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageImage” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page text
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 12 pt
                          • Left: 312 pt
                          • Bottom: 31 pt
                          • Right: 427 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageText” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page image BMP
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 84 pt
                          • Left: 618 pt
                          • Bottom: 103 pt
                          • Right: 775 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageImageBMP” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page image PNG
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 114 pt
                          • Left: 618 pt
                          • Bottom: 133 pt
                          • Right: 775 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageImagePNG” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page image TIFF
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 144 pt
                          • Left: 618 pt
                          • Bottom: 163 pt
                          • Right: 775 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageImageTIFF” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page image PNG with 300 dpi
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 174 pt
                          • Left: 616 pt
                          • Bottom: 193 pt
                          • Right: 825 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageImagePNGwithHighRes” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Extract one page
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 12 pt
                          • Left: 432 pt
                          • Bottom: 31 pt
                          • Right: 547 pt
                          • Anchoring: Left, Top
                          Perform Script [ “ExtractPage” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Update page statistics
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 204 pt
                          • Left: 616 pt
                          • Bottom: 223 pt
                          • Right: 825 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UpdatePageStats” ]

                          Scripts:


                          Script Hierarchy

                          InitDynaPDF
                          UpdatePageCount
                          UpdatePageImage
                          ExtractPage
                          UpdatePageText
                          UpdatePageStats
                          UpdatePageImageBMP
                          UpdatePageImageTIFF
                          UpdatePageImagePNG
                          UpdatePageImagePNGwithHighRes

                          Next Script: [UpdatePageCount]
                          Script NameInitDynaPDF
                          Run script with full access privilegesOff
                          Include In MenuYes
                          Layouts that use this script
                            Scripts that use this script
                            Script Definition
                            Script Steps
                            • #Locate DynaPDF library
                            • Set Variable [ $databasePath; Value:Get(FilePath) ]
                            • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                            • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                            • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                            • If [ Get(SystemPlatform) = -2 ]
                            • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dll" ) ]
                            • Else
                            • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dylib" ) ]
                            • End If
                            • #Initialize DynaPDF
                            • Set Variable [ $r; Value:MBS( "DynaPDF.Initialize"; $path) ]
                            • If [ $r ≠ "OK" ]
                            • Show Custom Dialog [ Title: "DynaPDF failed to initialize"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                            • Else
                            • Set Variable [ $$DynaPDFInited; Value:1 ]
                            • 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: [InitDynaPDF]Next Script: [UpdatePageImage]
                                          Script NameUpdatePageCount
                                          Run script with full access privilegesOff
                                          Include In MenuYes
                                          Layouts that use this script
                                          Scripts that use this script
                                            Script Definition
                                            Script Steps
                                            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: [UpdatePageCount]Next Script: [ExtractPage]
                                                  Script NameUpdatePageImage
                                                  Run script with full access privilegesOff
                                                  Include In MenuYes
                                                  Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • #Initialize DynaPDF if needed
                                                    • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                                    • Perform Script [ “InitDynaPDF” ]
                                                    • End If
                                                    • #Clear current PDF document
                                                    • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                                    • #Load PDF from container
                                                    • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Test::data) ]
                                                    • #Import all pages
                                                    • Set Variable [ $r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf) ]
                                                    • #Render one page as Picture
                                                    • Set Variable [ $r; Value:MBS("DynaPDF.RenderPage"; $pdf; Test::PageIndex) ]
                                                    • #Put in Container
                                                    • Set Field [ Test::PageImage; $r ]
                                                    • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                                                    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: [UpdatePageImage]Next Script: [UpdatePageText]
                                                          Script NameExtractPage
                                                          Run script with full access privilegesOff
                                                          Include In MenuYes
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • #Initialize DynaPDF if needed
                                                            • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                                            • Perform Script [ “InitDynaPDF” ]
                                                            • End If
                                                            • #Clear current PDF document
                                                            • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                                            • #Load PDF from container
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Test::data) ]
                                                            • #Import page one
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 1) ]
                                                            • #Set title
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.SetDocInfo"; $pdf; "Title"; "One page PDF") ]
                                                            • #Render one page as Picture
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.Save"; $pdf; "hello.pdf") ]
                                                            • #Put in Container
                                                            • Set Field [ Test::PageImage; $r ]
                                                            • #Cleanup
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                                                            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: [ExtractPage]Next Script: [UpdatePageStats]
                                                                  Script NameUpdatePageText
                                                                  Run script with full access privilegesOff
                                                                  Include In MenuYes
                                                                  Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    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: [UpdatePageText]Next Script: [UpdatePageImageBMP]
                                                                          Script NameUpdatePageStats
                                                                          Run script with full access privilegesOff
                                                                          Include In MenuYes
                                                                          Layouts that use this script
                                                                          Scripts that use this script
                                                                            Script Definition
                                                                            Script Steps
                                                                            • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                                                            • Perform Script [ “InitDynaPDF” ]
                                                                            • End If
                                                                            • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                                                            • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Test::data) ]
                                                                            • Set Variable [ $r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf) ]
                                                                            • Set Variable [ $stat; Value:MBS("DynaPDF.PageStatistics"; $pdf; Test::PageIndex) ]
                                                                            • Set Variable [ $Count; Value:ValueCount ( $stat ) ]
                                                                            • Set Variable [ $PatternCount; Value:MiddleValues ( $stat ; 1 ; 1 ) ]
                                                                            • Set Variable [ $TemplateCount; Value:MiddleValues ( $stat ; 2 ; 1 ) ]
                                                                            • Set Variable [ $BezierCount; Value:MiddleValues ( $stat ; 3 ; 1 ) ]
                                                                            • Set Variable [ $ClipPathCount; Value:MiddleValues ( $stat ; 4 ; 1 ) ]
                                                                            • Set Variable [ $ClosePathCount; Value:MiddleValues ( $stat ; 5 ; 1 ) ]
                                                                            • Set Variable [ $DrawShadingCount; Value:MiddleValues ( $stat ; 6 ; 1 ) ]
                                                                            • Set Variable [ $ImageCount; Value:MiddleValues ( $stat ; 7 ; 1 ) ]
                                                                            • Set Variable [ $LineCount; Value:MiddleValues ( $stat ; 8 ; 1 ) ]
                                                                            • Set Variable [ $RectangleCount; Value:MiddleValues ( $stat ; 9 ; 1 ) ]
                                                                            • Set Variable [ $TextCount; Value:MiddleValues ( $stat ; 10 ; 1 ) ]
                                                                            • Set Variable [ $TextLength; Value:MiddleValues ( $stat ; 11 ; 1 ) ]
                                                                            • Set Variable [ $LayerCount; Value:MiddleValues ( $stat ; 12 ; 1 ) ]
                                                                            • Set Variable [ $FontCount; Value:MiddleValues ( $stat ; 13 ; 1 ) ]
                                                                            • Set Field [ Test::PageStats; "PatternCount: " & $PatternCount & "TemplateCount: " & $TemplateCount & "BezierCount: " & $BezierCount & "ClipPathCount: " & $ClipPathCount & "ClosePathCount: " & $ClosePathCount & "DrawShadingCount: " & $DrawShadingCount & "ImageCount: " & $ImageCount & "LineCount: " & $LineCount & "RectangleCount: " & $RectangleCount & "TextCount: " & $TextCount & "TextLength: " & $TextLength & "LayerCount: " & $LayerCount & "FontCount: " & $FontCount ]
                                                                            • #Cleanup
                                                                            • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                                                                            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: [UpdatePageStats]Next Script: [UpdatePageImageTIFF]
                                                                                  Script NameUpdatePageImageBMP
                                                                                  Run script with full access privilegesOff
                                                                                  Include In MenuYes
                                                                                  Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    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: [UpdatePageImageBMP]Next Script: [UpdatePageImagePNG]
                                                                                          Script NameUpdatePageImageTIFF
                                                                                          Run script with full access privilegesOff
                                                                                          Include In MenuYes
                                                                                          Layouts that use this script
                                                                                          Scripts that use this script
                                                                                            Script Definition
                                                                                            Script Steps
                                                                                            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: [UpdatePageImageTIFF]Next Script: [UpdatePageImagePNGwithHighRes]
                                                                                                  Script NameUpdatePageImagePNG
                                                                                                  Run script with full access privilegesOff
                                                                                                  Include In MenuYes
                                                                                                  Layouts that use this script
                                                                                                  Scripts that use this script
                                                                                                    Script Definition
                                                                                                    Script Steps
                                                                                                    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: [UpdatePageImagePNG]
                                                                                                          Script NameUpdatePageImagePNGwithHighRes
                                                                                                          Run script with full access privilegesOff
                                                                                                          Include In MenuYes
                                                                                                          Layouts that use this script
                                                                                                          Scripts that use this script
                                                                                                            Script Definition
                                                                                                            Script Steps
                                                                                                            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: DynaPDF Test

                                                                                                                  Used functions:




                                                                                                                  Links
                                                                                                                  MBS Xojo tutorial videos