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

MBS FileMaker Plugin Example Databases

PDFKit Page Selector

All examples are included with download of MBS FileMaker Plugin.

PDFKit Page Selector.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts6
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
OnFirstWindowOpenScript: on_FirstWindowOpen_clearTheStage
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
PDFKit Page Select
9 fields defined, 0 record
PDFKit Page Select

Fields

Table Name: PDFKit Page Select - 9 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
PrimaryKeyNormal, TextAuto-Enter: 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
                                          InputPDFNormal, BinaryAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Global
                                          • Repetitions: 1
                                              PageNormal, BinaryAuto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                                  NumberNormal, NumberAuto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      OutputPDFNormal, BinaryAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Global
                                                      • Repetitions: 1

                                                          Layout Objects: PDFKit Page Select

                                                          Regular Fields

                                                          Field Name: PDFKit Page Select::InputPDF
                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                          • Top: 4 pt
                                                          • Left: 14 pt
                                                          • Bottom: 129 pt
                                                          • Right: 140 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: PDFKit Page Select::Page
                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                          • Top: 169 pt
                                                          • Left: 415 pt
                                                          • Bottom: 294 pt
                                                          • Right: 668 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: PDFKit Page Select::OutputPDF
                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                          • Top: 9 pt
                                                          • Left: 451 pt
                                                          • Bottom: 134 pt
                                                          • Right: 668 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: PDFKit Page Select::Page
                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                          • Top: 137 pt
                                                          • Left: 14 pt
                                                          • Bottom: 231 pt
                                                          • Right: 93 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          No

                                                          Field Name: PDFKit Page Select::Number
                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                          • Top: 140 pt
                                                          • Left: 102 pt
                                                          • Bottom: 164 pt
                                                          • Right: 167 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          No

                                                          Merge Fields

                                                          Field PropertiesCoordinatesFieldsQuick Find
                                                            Text:
                                                          • {{TotalRecordCount}} Pages
                                                          • Top: 117 pt
                                                          • Left: 126 pt
                                                          • Bottom: 130 pt
                                                          • Right: 255 pt
                                                          • Anchoring: Left, Top
                                                            No

                                                            Buttons

                                                            Button PropertiesCoordinatesScript/Script Step
                                                              Type:
                                                            • Text: Copy
                                                            • Top: 206 pt
                                                            • Left: 106 pt
                                                            • Bottom: 228 pt
                                                            • Right: 156 pt
                                                            • Anchoring: Left, Top
                                                            Perform Script [ “get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)”; Parameter: PDFKit Page Select::Number ]

                                                            Scripts:

                                                            Fields:


                                                            Button PropertiesCoordinatesScript/Script Step
                                                              Type:
                                                            • Text: to Desktop
                                                            • Top: 206 pt
                                                            • Left: 167 pt
                                                            • Bottom: 228 pt
                                                            • Right: 246 pt
                                                            • Anchoring: Left, Top
                                                            Perform Script [ “get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)”; Parameter: List ( PDFKit Page Select::Number; "Desktop" ) ]

                                                            Scripts:

                                                            Fields:


                                                            Popover Buttons

                                                            Popover Button PropertiesCoordinates
                                                              Type:
                                                            • Text:
                                                            • Top: 95 pt
                                                            • Left: 156 pt
                                                            • Bottom: 117 pt
                                                            • Right: 178 pt
                                                            • Anchoring: Left, Top
                                                            Popover PropertiesCoordinates
                                                              Show Title Bar:
                                                            • Yes
                                                              Title:
                                                            • "Instructions"
                                                              Position:
                                                            • Bottom
                                                            • Top: 128 pt
                                                            • Left: 56 pt
                                                            • Bottom: 497 pt
                                                            • Right: 278 pt
                                                            • Anchoring: Left, Top
                                                            Popover Content
                                                            Tab ControlsSlide ControlsFieldsButtonsPortalsWeb Viewer ControlsCharts

                                                                Portals

                                                                Portal PropertiesCoordinatesFieldsOptions
                                                                • Top: 136 pt
                                                                • Left: 4 pt
                                                                • Bottom: 744 pt
                                                                • Right: 275 pt
                                                                • Anchoring: Left, Top
                                                                Field Objects
                                                                • Sort records: Off
                                                                • Filter calculation: None
                                                                • Initial Row: 1
                                                                • Number of Rows: 6
                                                                • Show vertical scroll bar
                                                                • Allow deletion of portal records

                                                                Script Hierarchy

                                                                on_FirstWindowOpen_clearTheStage
                                                                do_Show_PDFPageSelector (pTop; pLeft)
                                                                -
                                                                trg_onModify_DeleteolaAndSplitNew
                                                                do_split_PDFinPages_onMac
                                                                get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)

                                                                Next Script: [do_Show_PDFPageSelector (pTop; pLeft)]
                                                                Script Nameon_FirstWindowOpen_clearTheStage
                                                                Run script with full access privilegesOff
                                                                Siri Shortcut VisibleOff
                                                                Include In MenuNo
                                                                Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • #Script: on_FirstWindowOpen
                                                                    • #Minimize Window to show fully show Layout without Toolbar, empty out all previous data
                                                                    • Go to Layout [ “PDFKit Page Select” ]
                                                                    • Show/Hide Toolbars [ Hide ]
                                                                    • Show All Records
                                                                    • Delete All Records [ No dialog ]
                                                                    • Set Field [ PDFKit Page Select::InputPDF; "" ]
                                                                    • Adjust Window [ Resize to Fit ]
                                                                    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: [on_FirstWindowOpen_clearTheStage]Next Script: [-]
                                                                          Script Namedo_Show_PDFPageSelector (pTop; pLeft)
                                                                          Run script with full access privilegesOff
                                                                          Siri Shortcut VisibleOff
                                                                          Include In MenuYes
                                                                          Layouts that use this script
                                                                            Scripts that use this script
                                                                              Script Definition
                                                                              Script Steps
                                                                              • #Script: do_Show_PDFPageSelector (pTop; pLeft)
                                                                              • Set Variable [ $Params; Value:Get ( ScriptParameter ) ]
                                                                              • Set Variable [ $pTop; Value:GetValue ( $Params ; 1 ) ]
                                                                              • Set Variable [ $pLeft; Value:GetValue ( $Params ; 2 ) ]
                                                                              • Move/Resize Window [ Current Window; Top: $pTop; Left: $pLeft ]
                                                                              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: [do_Show_PDFPageSelector (pTop; pLeft)]Next Script: [trg_onModify_DeleteolaAndSplitNew]
                                                                                            Script Name-
                                                                                            Run script with full access privilegesOff
                                                                                            Siri Shortcut VisibleOff
                                                                                            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: [-]Next Script: [do_split_PDFinPages_onMac]
                                                                                                                Script Nametrg_onModify_DeleteolaAndSplitNew
                                                                                                                Run script with full access privilegesOff
                                                                                                                Siri Shortcut VisibleOff
                                                                                                                Include In MenuNo
                                                                                                                Layouts that use this script
                                                                                                                  Scripts that use this script
                                                                                                                    Script Definition
                                                                                                                    Script Steps
                                                                                                                    • If [ IsEmpty ( PDFKit Page Select::InputPDF ) ]
                                                                                                                    • Exit Script [ ]
                                                                                                                    • End If
                                                                                                                    • Show All Records
                                                                                                                    • Delete All Records [ No dialog ]
                                                                                                                    • Perform Script [ “do_split_PDFinPages_onMac” ]
                                                                                                                    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: [trg_onModify_DeleteolaAndSplitNew]Next Script: [get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)]
                                                                                                                          Script Namedo_split_PDFinPages_onMac
                                                                                                                          Run script with full access privilegesOff
                                                                                                                          Siri Shortcut VisibleOff
                                                                                                                          Include In MenuYes
                                                                                                                          Layouts that use this script
                                                                                                                            Scripts that use this script
                                                                                                                            Script Definition
                                                                                                                            Script Steps
                                                                                                                            • #Script: do_split_PDFinPages_onMac
                                                                                                                            • #assumes a PDF file is placed in global container in this table (PDFKit Page Select) Loads the file into a variable, uses MBS V. 14.1 or later to count pages and then puts a small JPEG of each contained page into a new records container for ThumbNail type of display along with the page number (Numbers start from zero, for ease of displax one is added) and finally releases the occupied memory with MBS Function 'PDFKit.release'
                                                                                                                            • #Mac or iOS. For Windows and Linux use DynaPDF
                                                                                                                            • Set Variable [ $pdf; Value:MBS( "PDFKit.OpenContainer"; PDFKit Page Select::InputPDF ) ]
                                                                                                                            • Set Variable [ $count; Value:MBS( "PDFKit.GetPDFPageCount"; $PDF ) ]
                                                                                                                            • Set Variable [ $index; Value:1 ]
                                                                                                                            • Set Variable [ $resolution; Value:72 ]
                                                                                                                            • If [ $index ≤ $count ]
                                                                                                                            • Loop [ Flush: Always ]
                                                                                                                            • #your script steps here
                                                                                                                            • New Record/Request
                                                                                                                            • Set Field [ PDFKit Page Select::Number; $index ]
                                                                                                                            • Set Field [ PDFKit Page Select::Page; MBS( "PDFKit.GetPDFPageImage"; $PDF; $index-1; "JPEG"; "Page.jpg"; $resolution) ]
                                                                                                                            • Commit Records/Requests [ No dialog ]
                                                                                                                            • #next
                                                                                                                            • Set Variable [ $index; Value:$index + 1 ]
                                                                                                                            • Exit Loop If [ $index > $count ]
                                                                                                                            • End Loop
                                                                                                                            • End If
                                                                                                                            • Set Variable [ $count; Value:MBS( "PDFKit.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: [do_split_PDFinPages_onMac]
                                                                                                                                    Script Nameget_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)
                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                    Siri Shortcut VisibleOff
                                                                                                                                    Include In MenuYes
                                                                                                                                    Layouts that use this script
                                                                                                                                    Scripts that use this script
                                                                                                                                      Script Definition
                                                                                                                                      Script Steps
                                                                                                                                      • #Script: get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)
                                                                                                                                      • #assumes a PDF file is placed in global container in this table (PDFKit Page Select) Retrieves the page number (Numbers start from zero, for ease of display 1 is added) and stores the pdf in the destination field. If no Parameter with the name is given, it tries a default in this table.
                                                                                                                                      • #Mac or iOS. For Windows and Linux use DynaPDF
                                                                                                                                      • Set Variable [ $Params; Value:Get ( ScriptParameter ) ]
                                                                                                                                      • Set Variable [ $pPageNum; Value:GetValue ( $Params ; 1 ) ]
                                                                                                                                      • Set Variable [ $pDestinationFieldName; Value:GetValue ( $Params ; 2 ) ]
                                                                                                                                      • Set Variable [ $pageSelected; Value:If ( $pPageNum; $pPageNum-1; PDFKit Page Select::Number-1 ) ]
                                                                                                                                      • Set Variable [ $pageOutput; Value:If ( $pDestinationFieldName <> "" and $pDestinationFieldName <> "Desktop"; $pDestinationFieldName; GetFieldName ( PDFKit Page Select::OutputPDF )) ]
                                                                                                                                      • Set Field By Name [ $pageOutput; MBS( "PDFKit.GetPDFPagePDF"; PDFKit Page Select::InputPDF; $pageSelected; "page.pdf") ]
                                                                                                                                      • // Set Field [ PDFKit Page Select::OutputPDF; MBS( "PDFKit.GetPDFPagePDF"; PDFKit Page Select::InputPDF; $pageSelected; "page.pdf") ]
                                                                                                                                      • Set Variable [ $Error; Value:Get ( LastError ) ]
                                                                                                                                      • If [ not $Error ]
                                                                                                                                      • Go to Field [ PDFKit Page Select::OutputPDF ] [ Select/perform ]
                                                                                                                                      • If [ $pDestinationFieldName = "" ]
                                                                                                                                      • Copy [ ] [ Select ]
                                                                                                                                      • Else If [ $pDestinationFieldName = "Desktop" ]
                                                                                                                                      • Set Variable [ $outFile; Value:Get ( DesktopPath ) & "Page_" & PDFKit Page Select::Number & ".pdf" ]
                                                                                                                                      • Export Field Contents [ PDFKit Page Select::OutputPDF; “$outFile”; Automatically open; Create folders:Yes ]
                                                                                                                                      • End If
                                                                                                                                      • Go to Field [ ]
                                                                                                                                      • End If
                                                                                                                                      • Exit Script [ ]
                                                                                                                                      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: PDFKit Page Selector

                                                                                                                                              Used functions: