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
Tables 1
Relationships 0
Layouts 1
Scripts 6
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Enlightened
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields On
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Script: on_FirstWindowOpen_clearTheStage
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

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

Fields

Table Name: PDFKit Page Select - 9 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
PrimaryKey Normal, Text Auto-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
          CreationTimestamp Normal, Timestamp Auto-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
                  CreatedBy Normal, Text Auto-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
                          ModificationTimestamp Normal, Timestamp Auto-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
                                  ModifiedBy Normal, Text Auto-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
                                          InputPDF Normal, Binary Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Global
                                          • Repetitions: 1
                                              Page Normal, Binary Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                                  Number Normal, Number Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      OutputPDF Normal, Binary Auto-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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 140 pt
                                                          • Left: 102 pt
                                                          • Bottom: 164 pt
                                                          • Right: 167 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          No

                                                          Merge Fields

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

                                                            Buttons

                                                            Button Properties Coordinates Script/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 Properties Coordinates Script/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 Properties Coordinates
                                                              Type:
                                                            • Text:
                                                            • Top: 95 pt
                                                            • Left: 156 pt
                                                            • Bottom: 117 pt
                                                            • Right: 178 pt
                                                            • Anchoring: Left, Top
                                                            Popover Properties Coordinates
                                                              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 Controls Slide Controls Fields Buttons Portals Web Viewer Controls Charts

                                                                Portals

                                                                Portal Properties Coordinates Fields Options
                                                                • 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 Name on_FirstWindowOpen_clearTheStage
                                                                Run script with full access privileges Off
                                                                Siri Shortcut Visible Off
                                                                Include In Menu No
                                                                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 Name do_Show_PDFPageSelector (pTop; pLeft)
                                                                          Run script with full access privileges Off
                                                                          Siri Shortcut Visible Off
                                                                          Include In Menu Yes
                                                                          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 privileges Off
                                                                                            Siri Shortcut Visible Off
                                                                                            Include In Menu Yes
                                                                                            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 Name trg_onModify_DeleteolaAndSplitNew
                                                                                                                Run script with full access privileges Off
                                                                                                                Siri Shortcut Visible Off
                                                                                                                Include In Menu No
                                                                                                                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 Name do_split_PDFinPages_onMac
                                                                                                                          Run script with full access privileges Off
                                                                                                                          Siri Shortcut Visible Off
                                                                                                                          Include In Menu Yes
                                                                                                                          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 Name get_somePageFromPDFand_SaveTo (pPageNum; pDestinationFieldName)
                                                                                                                                    Run script with full access privileges Off
                                                                                                                                    Siri Shortcut Visible Off
                                                                                                                                    Include In Menu Yes
                                                                                                                                    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: