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

MBS FileMaker Plugin Example Databases

Barcodes from Invoices

All examples are included with download of MBS FileMaker Plugin.

Barcodes from Invoices.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 7
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
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 Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Barcodes from Invoices
9 fields defined, 1 record
Barcodes from Invoices

Fields

Table Name: Barcodes from Invoices - 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
                                          PDF Normal, Binary Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                              Barcode Text Normal, Text Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  Image Normal, Binary Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                      Log Normal, Text Auto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German

                                                          Layout Objects: Barcodes from Invoices

                                                          Regular Fields

                                                          Field Name: Barcodes from Invoices::PDF
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 126 pt
                                                          • Left: 116 pt
                                                          • Bottom: 439 pt
                                                          • Right: 430 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: Barcodes from Invoices::Image
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 447 pt
                                                          • Left: 116 pt
                                                          • Bottom: 760 pt
                                                          • Right: 430 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: Barcodes from Invoices::Barcode Text
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 125 pt
                                                          • Left: 579 pt
                                                          • Bottom: 438 pt
                                                          • Right: 893 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          Yes

                                                          Field Name: Barcodes from Invoices::Log
                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                          • Top: 447 pt
                                                          • Left: 579 pt
                                                          • Bottom: 753 pt
                                                          • Right: 893 pt
                                                          • Anchoring: Left, Top
                                                          Field Format:
                                                          • Edit Box
                                                          Field Behavior:
                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                          • Touch keyboard type: Default for Data Type
                                                          • Go to next field using: Tab key
                                                          Yes

                                                          Buttons

                                                          Button Properties Coordinates Script/Script Step
                                                            Type:
                                                          • Text: Import PDF
                                                          • Top: 37 pt
                                                          • Left: 520 pt
                                                          • Bottom: 73 pt
                                                          • Right: 652 pt
                                                          • Anchoring: Left, Top
                                                          Perform Script [ “Import PDF” ]

                                                          Scripts:


                                                          Button Properties Coordinates Script/Script Step
                                                            Type:
                                                          • Text: Recognize
                                                          • Top: 38 pt
                                                          • Left: 652 pt
                                                          • Bottom: 74 pt
                                                          • Right: 784 pt
                                                          • Anchoring: Left, Top
                                                          Perform Script [ “Recognize” ]

                                                          Scripts:


                                                          Script Hierarchy

                                                          Recognize
                                                          Clear
                                                          Check Image
                                                          Found Barcode
                                                          Load zbar
                                                          InitDynaPDF
                                                          Import PDF

                                                          Next Script: [Clear]
                                                          Script Name Recognize
                                                          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
                                                            • #first loop to get images from PDF
                                                            • Set Variable [ $$log; Value:"" ]
                                                            • Set Field [ Barcodes from Invoices::Image; $$log ]
                                                            • Set Field [ Barcodes from Invoices::Barcode Text; $$log ]
                                                            • Set Field [ Barcodes from Invoices::Log; $$log ]
                                                            • #400 dpi seems to be fine
                                                            • Set Variable [ $dpi; Value:400 ]
                                                            • #try PDFKit. Can be skipped if you have DynaPDF license
                                                            • Set Variable [ $success; Value:False ]
                                                            • If [ MBS("IsMacOS") or MBS("IsIOS") ]
                                                            • Set Variable [ $pdf; Value:MBS( "PDFKit.OpenContainer"; Barcodes from Invoices::PDF ) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Variable [ $count; Value:MBS( "PDFKit.GetPDFPageCount"; $PDF ) ]
                                                            • Set Variable [ $index; Value:1 ]
                                                            • If [ $index ≤ $count ]
                                                            • Loop [ Flush: Defer ]
                                                            • #Make 300 dpi image
                                                            • Set Variable [ $$log; Value:$$log & "PDFKit render page " & $index & ¶ ]
                                                            • Set Variable [ $image; Value:MBS( "PDFKit.GetPDFPageImage"; $pdf; $index-1; "PNG"; "page.png"; $dpi) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Field [ Barcodes from Invoices::Image; $image ]
                                                            • Perform Script [ “Check Image” ]
                                                            • Set Variable [ $success; Value:Get(ScriptResult) ]
                                                            • Exit Loop If [ $success ]
                                                            • End If
                                                            • #next
                                                            • Set Variable [ $index; Value:$index + 1 ]
                                                            • Exit Loop If [ $index > $count ]
                                                            • End Loop
                                                            • End If
                                                            • End If
                                                            • End If
                                                            • #try Windows PDF. Can be skipped if you have DynaPDF license
                                                            • If [ MBS("IsWindows") ]
                                                            • Set Variable [ $pdf; Value:MBS( "WinPDF.LoadContainer"; Barcodes from Invoices::PDF ) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Variable [ $count; Value:MBS( "WinPDF.PageCount"; $PDF ) ]
                                                            • Set Variable [ $index; Value:1 ]
                                                            • If [ $index ≤ $count ]
                                                            • Loop [ Flush: Defer ]
                                                            • #Make 300 dpi image
                                                            • Set Variable [ $$log; Value:$$log & "WinPDF render page " & $index & ¶ ]
                                                            • Set Variable [ $image; Value:MBS( "WinPDF.PageImage"; $pdf; $index-1; "PNG"; "page.png"; $dpi) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Field [ Barcodes from Invoices::Image; $image ]
                                                            • Perform Script [ “Check Image” ]
                                                            • Set Variable [ $success; Value:Get(ScriptResult) ]
                                                            • Exit Loop If [ $success ]
                                                            • End If
                                                            • #next
                                                            • Set Variable [ $index; Value:$index + 1 ]
                                                            • Exit Loop If [ $index > $count ]
                                                            • End Loop
                                                            • End If
                                                            • End If
                                                            • End If
                                                            • #try DynaPDF to render images, which works everywhere when library got loaded
                                                            • If [ not $success ]
                                                            • #Initialize DynaPDF if needed
                                                            • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                                            • Perform Script [ “InitDynaPDF” ]
                                                            • End If
                                                            • If [ MBS("DynaPDF.IsInitialized") ]
                                                            • #Clear current PDF document
                                                            • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Barcodes from Invoices::PDF) ]
                                                            • Set Variable [ $r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Variable [ $count; Value:MBS("DynaPDF.GetPageCount"; $pdf) ]
                                                            • Set Variable [ $index; Value:1 ]
                                                            • If [ $index ≤ $count ]
                                                            • Loop [ Flush: Defer ]
                                                            • #Make 300 dpi image
                                                            • Set Variable [ $$log; Value:$$log & "DynaPDF render page " & $index & ¶ ]
                                                            • Set Variable [ $image; Value:MBS( "DynaPDF.RenderPage"; $pdf; $index; $dpi) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Field [ Barcodes from Invoices::Image; $image ]
                                                            • Perform Script [ “Check Image” ]
                                                            • Set Variable [ $success; Value:Get(ScriptResult) ]
                                                            • Exit Loop If [ $success ]
                                                            • End If
                                                            • #next
                                                            • Set Variable [ $index; Value:$index + 1 ]
                                                            • Exit Loop If [ $index > $count ]
                                                            • End Loop
                                                            • End If
                                                            • End If
                                                            • #Cleanup
                                                            • Set Variable [ $r; Value:MBS( "DynaPDF.Release"; $pdf ) ]
                                                            • End If
                                                            • End If
                                                            • Set Field [ Barcodes from Invoices::Log; $$log ]
                                                            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: [Recognize] Next Script: [Check Image]
                                                                  Script Name Clear
                                                                  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
                                                                      • Set Variable [ $$Log; Value:"" ]
                                                                      • Set Field [ Barcodes from Invoices::Image; "" ]
                                                                      • Set Field [ Barcodes from Invoices::Barcode Text; "" ]
                                                                      • Set Field [ Barcodes from Invoices::Log; "" ]
                                                                      • Set Field [ Barcodes from Invoices::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: [Clear] Next Script: [Found Barcode]
                                                                              Script Name Check Image
                                                                              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
                                                                                • #we got an image, so look for qr-codes
                                                                                • #try Vision
                                                                                • If [ MBS("IsMacOS") or MBS("IsIOS") ]
                                                                                • Set Variable [ $r; Value:MBS( "Vision.DetectBarcode"; Barcodes from Invoices::Image; "VNBarcodeSymbologyQR" ) ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "Vision got an error: " & $r & ¶ ]
                                                                                • Else If [ Length ( $r ) > 1 ]
                                                                                • Set Variable [ $json; Value:$r ]
                                                                                • #we can handle multiple barcodes here
                                                                                • Set Variable [ $arrayCount; Value:MBS( "JSON.GetArraySize"; $json ) ]
                                                                                • If [ $arrayCount > 0 ]
                                                                                • Set Variable [ $index; Value:0 ]
                                                                                • Loop [ Flush: Always ]
                                                                                • Set Variable [ $r; Value:JSONGetElement ( $json ; "[" & $index & "].value" ) ]
                                                                                • #you may need to check if $r is what you look for here
                                                                                • If [ Length ( $r ) > 20 ]
                                                                                • Set Variable [ $$log; Value:$$log & "Found barcode via Vision." & ¶ ]
                                                                                • Perform Script [ “Found Barcode”; Parameter: $r ]
                                                                                • Exit Script [ Result: True ]
                                                                                • End If
                                                                                • #next
                                                                                • Set Variable [ $index; Value:$index + 1 ]
                                                                                • Exit Loop If [ $index > $arrayCount ]
                                                                                • End Loop
                                                                                • End If
                                                                                • End If
                                                                                • End If
                                                                                • #try Barcode.Detect
                                                                                • Set Variable [ $r; Value:MBS("Barcode.Detect"; Barcodes from Invoices::Image; "QRCode"; 0; 1; "UTF-8") ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "ZXing got an error: " & $r & ¶ ]
                                                                                • Else If [ Length ( $r ) > 1 ]
                                                                                • Set Variable [ $$log; Value:$$log & "Found barcode via zxing." & ¶ ]
                                                                                • Perform Script [ “Found Barcode”; Parameter: $r ]
                                                                                • Exit Script [ Result: True ]
                                                                                • End If
                                                                                • #try Zbar
                                                                                • If [ MBS("Barcode.Loaded") ≠ 1 ]
                                                                                • Set Variable [ $r; Value:MBS("Barcode.Scan"; Barcodes from Invoices::Image) ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "Zbar got an error: " & $r & ¶ ]
                                                                                • Else If [ Length ( $r ) > 1 ]
                                                                                • Set Variable [ $json; Value:$r ]
                                                                                • Set Variable [ $arrayCount; Value:MBS( "JSON.GetArraySize"; $json ) ]
                                                                                • If [ $arrayCount > 0 ]
                                                                                • Set Variable [ $r; Value:JSONGetElement ( $json ; "[0].text" ) ]
                                                                                • Set Variable [ $$log; Value:$$log & "Found barcode via zbar." & ¶ ]
                                                                                • Perform Script [ “Found Barcode”; Parameter: $r ]
                                                                                • Exit Script [ Result: True ]
                                                                                • End If
                                                                                • End If
                                                                                • End If
                                                                                • If [ 0 ]
                                                                                • #GraphicsMagick crop the section for swiss barcodes and try it
                                                                                • Set Variable [ $image; Value:MBS("GMImage.NewFromContainer"; Barcodes from Invoices::Image) ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "GraphicsMagick got an error: " & $r & ¶ ]
                                                                                • Else
                                                                                • #crop coordinates for hitting barcode on swiss invoices
                                                                                • Set Variable [ $r; Value:MBS("GMImage.Crop"; $image; "1000x1000+700+2650") ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "GraphicsMagick got an error: " & $r & ¶ ]
                                                                                • Else
                                                                                • Set Variable [ $NewImage; Value:MBS("GMImage.WriteToPNGContainer"; $image; "crop.png") ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "GraphicsMagick got an error: " & $NewImage & ¶ ]
                                                                                • Else
                                                                                • Set Field [ Barcodes from Invoices::Image; $NewImage ]
                                                                                • #try Barcode.Detect
                                                                                • Set Variable [ $r; Value:MBS("Barcode.Detect"; $NewImage; "QRCode"; 0; 1; "UTF-8") ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "ZXing got an error: " & $r & ¶ ]
                                                                                • Else If [ Length ( $r ) > 1 ]
                                                                                • Set Variable [ $$log; Value:$$log & "Found barcode via zxing in crop." & ¶ ]
                                                                                • Perform Script [ “Found Barcode”; Parameter: $r ]
                                                                                • Exit Script [ Result: True ]
                                                                                • End If
                                                                                • #try Zbar
                                                                                • If [ MBS("Barcode.Loaded") ≠ 1 ]
                                                                                • Set Variable [ $r; Value:MBS("Barcode.Scan"; $NewImage) ]
                                                                                • If [ MBS("IsError") ]
                                                                                • Set Variable [ $$log; Value:$$log & "Zbar got an error: " & $r & ¶ ]
                                                                                • Else If [ Length ( $r ) > 1 ]
                                                                                • Set Variable [ $json; Value:$r ]
                                                                                • Set Variable [ $arrayCount; Value:MBS( "JSON.GetArraySize"; $json ) ]
                                                                                • If [ $arrayCount > 0 ]
                                                                                • Set Variable [ $r; Value:JSONGetElement ( $json ; "[0].text" ) ]
                                                                                • Set Variable [ $$log; Value:$$log & "Found barcode via zbar in crop." & ¶ ]
                                                                                • Perform Script [ “Found Barcode”; Parameter: $r ]
                                                                                • Exit Script [ Result: True ]
                                                                                • End If
                                                                                • End If
                                                                                • End If
                                                                                • End If
                                                                                • End If
                                                                                • Set Variable [ $r; Value:MBS("GMImage.Release"; $image) ]
                                                                                • End If
                                                                                • End If
                                                                                • Exit Script [ Result: False ]
                                                                                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: [Check Image] Next Script: [Load zbar]
                                                                                      Script Name Found Barcode
                                                                                      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
                                                                                        • Set Variable [ $text; Value:Get(ScriptParameter) ]
                                                                                        • Set Variable [ $text; Value:MBS("Text.ReplaceNewline"; $text; 1) ]
                                                                                        • Set Field [ Barcodes from Invoices::Barcode Text; $text ]
                                                                                        • #now process text
                                                                                        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: [Found Barcode] Next Script: [InitDynaPDF]
                                                                                                Script Name Load zbar
                                                                                                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
                                                                                                    • // Show Custom Dialog [ Title: "Please change path to library."; Message: "You need to download zbar library for macOS, Windows or Linux and put path in script."; Default Button: “OK”, Commit: “Yes” ]
                                                                                                    • // Exit Script [ ]
                                                                                                    • If [ MBS("IsWindows") ]
                                                                                                    • #you may need to download zbar from our Libs folder or get your own
                                                                                                    • #our copy of the library has a dependency, so we load libiconv first
                                                                                                    • Set Variable [ $path; Value:"C:\Users\Christian\Desktop\libiconv.dll" ]
                                                                                                    • Set Variable [ $r; Value:MBS( "Process.LoadLibrary"; $Path ) ]
                                                                                                    • #now we can load zbar dll
                                                                                                    • Set Variable [ $path; Value:"C:\Users\Christian\Desktop\libzbar64-0.dll" ]
                                                                                                    • Else If [ MBS("isMacOS") ]
                                                                                                    • #you may need to download zbar from our Libs folder or get your own
                                                                                                    • Set Variable [ $path; Value:"/Users/cs/Desktop/libzbar.0.dylib" ]
                                                                                                    • Else If [ MBS("isLinux") ]
                                                                                                    • #you may need to install first: sudo apt-get install libzbar0
                                                                                                    • Set Variable [ $path; Value:"/usr/lib/x86_64-linux-gnu/libzbar.so.0" ]
                                                                                                    • Else
                                                                                                    • Show Custom Dialog [ Title: "Unsupported platform"; Message: "No library coded for this platform or no MBS Plugin installed."; Default Button: “OK”, Commit: “Yes” ]
                                                                                                    • Halt Script
                                                                                                    • End If
                                                                                                    • #load zbar
                                                                                                    • Set Variable [ $r; Value:MBS("Barcode.LoadLibrary"; $path) ]
                                                                                                    • If [ MBS("IsError") ]
                                                                                                    • Show Custom Dialog [ Title: "Failed to load library"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                    • 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: [Load zbar] Next Script: [Import PDF]
                                                                                                                  Script Name InitDynaPDF
                                                                                                                  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
                                                                                                                    • #Locate DynaPDF library
                                                                                                                    • #you can have libraries in container and export at runtime to folder of your choice.
                                                                                                                    • #Or install library somewhere and pass path.
                                                                                                                    • #If library is in same folder as plugin, you can only pass only file name.
                                                                                                                    • If [ MBS("IsServer") ]
                                                                                                                    • #Put the path you use for your server here:
                                                                                                                    • If [ Get(SystemPlatform) = -2 ]
                                                                                                                    • #Server on Windows
                                                                                                                    • Set Variable [ $path; Value:"C:\Programs\FileMaker Server\dynapdf.dll" ]
                                                                                                                    • Else If [ MBS("IsLinux") ]
                                                                                                                    • #Server on Linux for FileMaker Cloud
                                                                                                                    • Set Variable [ $path; Value:"/opt/FileMaker/FileMaker Server/dynapdf.linux.so" ]
                                                                                                                    • Else
                                                                                                                    • #Server on Mac
                                                                                                                    • Set Variable [ $path; Value: "/Library/FileMaker Server/dynapdf.dylib" ]
                                                                                                                    • End If
                                                                                                                    • Else
                                                                                                                    • #For desktop and our examples we look in same folder as database:
                                                                                                                    • 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" ) ]
                                                                                                                    • #plugin will look for dynapdf.dll and if not found also for dynapdf.dll (64-bit) and dynapdf32.dll (32-bit).
                                                                                                                    • Else
                                                                                                                    • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dylib" ) ]
                                                                                                                    • #Mac dylib is usually 32 and 64 bit together.
                                                                                                                    • End If
                                                                                                                    • End If
                                                                                                                    • #You can test for free.
                                                                                                                    • #If you like to get a dynapdf license, please follow links on our pricing page:
                                                                                                                    • #https://www.monkeybreadsoftware.de/filemaker/pricing.shtml
                                                                                                                    • Set Variable [ $LicenseKey; Value:"" // put your key here or leave empty for demo. // Use e.g. "Lite", "Pro" or "Starter" to use demo mode for just that mode. ]
                                                                                                                    • Set Variable [ $r; Value:MBS( "DynaPDF.Initialize"; $path; $LicenseKey) ]
                                                                                                                    • If [ $r ≠ "OK" ]
                                                                                                                    • Show Custom Dialog [ Title: "Error loading DynaPDF Library"; Message: $r; Default Button: “OK”, Commit: “No” ]
                                                                                                                    • Halt Script
                                                                                                                    • 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]
                                                                                                                                  Script Name Import PDF
                                                                                                                                  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
                                                                                                                                    • Go to Layout [ “Barcodes from Invoices” ]
                                                                                                                                    • Insert File [ Barcodes from Invoices::PDF ] [ Filters ] [ "PDF Files": ( *.pdf ) ] [ Storage method: Let user choose ] [ Display content ] [ Compression: Never compress ]
                                                                                                                                    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: Barcodes from Invoices

                                                                                                                                          Used functions: