MBS FileMaker Plugin Example Databases

Create PDF with Bezier Curves

All examples are included with download of MBS FileMaker Plugin.

Create PDF with Bezier Curves.fmp12

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

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Create PDF with Bezier Curves
1 field defined, 1 record
Create PDF with Bezier Curves

Fields

Table Name: Create PDF with Bezier Curves - 1 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
OutputNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1

      Layout Objects: Create PDF with Bezier Curves

      Regular Fields

      Field Name: Create PDF with Bezier Curves::Output
      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
      • Top: 24 pt
      • Left: 138 pt
      • Bottom: 731 pt
      • Right: 661 pt
      • Anchoring: Left, Top
      Field Format:
      • Edit Box
      Field Behavior:
      • Allow field to be entered: In Find mode, In Browse mode
      • Touch keyboard type: System Default
      • Go to next field using: Tab key
      No

      Group Buttons

      Button PropertiesCoordinatesScript/Script Step
        Type:
      • Text: Create PDF
        Additional Properties:
      • Change to hand cursor over button
      • Rectangular
      • Top: 48 pt
      • Left: 18 pt
      • Bottom: 73 pt
      • Right: 127 pt
      • Anchoring: Left, Top
      Perform Script [ “Run” ]

      Scripts:


      Script Hierarchy

      Run
      Bezier1
      Bezier2
      Bezier3
      InitDynaPDF

      Next Script: [Bezier1]
      Script NameRun
      Run script with full access privilegesOff
      Include In MenuYes
      Layouts that use this script
      Scripts that use this script
        Script Definition
        Script Steps
        • #Initialize DynaPDF if needed
        • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
        • Perform Script [ “InitDynaPDF” ]
        • End If
        • #Clear current PDF document
        • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
        • #Add page
        • Set Variable [ $r; Value:MBS("DynaPDF.AppendPage"; $pdf) ]
        • Set Variable [ $r; Value:MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12) ]
        • Set Variable [ $r; Value:MBS( "DynaPDF.SetFillColor"; $PDF; 100; 100; 100 ) ]
        • Set Variable [ $r; Value:MBS( "DynaPDF.SetColorSpace"; $PDF; "rgb") ]
        • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; ,4; ,4; ,4 ) ]
        • #Bezier
        • Perform Script [ “Bezier1”; Parameter: $pdf ]
        • Perform Script [ “Bezier2”; Parameter: $pdf ]
        • Perform Script [ “Bezier3”; Parameter: $pdf ]
        • #End page
        • Set Variable [ $r; Value:MBS("DynaPDF.EndPage"; $pdf) ]
        • #Render one page as Picture
        • Set Variable [ $PDFData; Value:MBS("DynaPDF.Save"; $pdf; "hello.pdf") ]
        • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
        • #Put in Container
        • Set Field [ Create PDF with Bezier Curves::Output; $PDFData ]
        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: [Run]Next Script: [Bezier2]
              Script NameBezier1
              Run script with full access privilegesOff
              Include In MenuNo
              Layouts that use this script
                Scripts that use this script
                Script Definition
                Script Steps
                • #get PDF
                • Set Variable [ $pdf; Value:Get(ScriptParameter) ]
                • #coordinates
                • Set Variable [ $x0; Value:100 ]
                • Set Variable [ $y0; Value:100 ]
                • Set Variable [ $x1; Value:100 ]
                • Set Variable [ $y1; Value:300 ]
                • Set Variable [ $x2; Value:300 ]
                • Set Variable [ $y2; Value:300 ]
                • Set Variable [ $x3; Value:300 ]
                • Set Variable [ $y3; Value:100 ]
                • #rectangle
                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 2 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; ,4; ,4; ,4 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.Rectangle"; $pdf; $x0; $y0; 200; 200; "stroke" ) ]
                • #draw bezier
                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 5 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; 1; 0; 0 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.MoveTo"; $PDF; $x0; $y0 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.Bezier123"; $PDF; $x1; $y1; $x2; $y2; $x3; $y3 ) ]
                • Set Variable [ $r; Value:MBS( "DynaPDF.StrokePath"; $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: [Bezier1]Next Script: [Bezier3]
                              Script NameBezier2
                              Run script with full access privilegesOff
                              Include In MenuNo
                              Layouts that use this script
                                Scripts that use this script
                                Script Definition
                                Script Steps
                                • #get PDF
                                • Set Variable [ $pdf; Value:Get(ScriptParameter) ]
                                • #coordinates
                                • Set Variable [ $x0; Value:100 ]
                                • Set Variable [ $y0; Value:320 ]
                                • Set Variable [ $x1; Value:100 ]
                                • Set Variable [ $y1; Value:520 ]
                                • Set Variable [ $x2; Value:300 ]
                                • Set Variable [ $y2; Value:520 ]
                                • Set Variable [ $x3; Value:300 ]
                                • Set Variable [ $y3; Value:320 ]
                                • #rectangle
                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 2 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; ,4; ,4; ,4 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.Rectangle"; $pdf; $x0; $y0; 200; 200; "Stroke" ) ]
                                • #draw bezier
                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 5 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF;0; 0; 1 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.MoveTo"; $PDF; $x0; $y0 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.Bezier13"; $PDF; $x1; $y1; $x3; $y3 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.StrokePath"; $PDF) ]
                                • #draw bezier
                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF;0; 1; 0 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.MoveTo"; $PDF; $x0; $y0 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.Bezier23"; $PDF; $x2; $y2; $x3; $y3 ) ]
                                • Set Variable [ $r; Value:MBS( "DynaPDF.StrokePath"; $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: [Bezier2]Next Script: [InitDynaPDF]
                                              Script NameBezier3
                                              Run script with full access privilegesOff
                                              Include In MenuNo
                                              Layouts that use this script
                                                Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • #get PDF
                                                • Set Variable [ $pdf; Value:Get(ScriptParameter) ]
                                                • #coordinates
                                                • Set Variable [ $x0; Value:100 ]
                                                • Set Variable [ $y0; Value:540 ]
                                                • Set Variable [ $x1; Value:100 ]
                                                • Set Variable [ $y1; Value:740 ]
                                                • Set Variable [ $x2; Value:300 ]
                                                • Set Variable [ $y2; Value:540 ]
                                                • Set Variable [ $x3; Value:300 ]
                                                • Set Variable [ $y3; Value:740 ]
                                                • #rectangle
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 2 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; ,4; ,4; ,4 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.Rectangle"; $pdf; $x0; $y0; 200; 200; "Stroke" ) ]
                                                • #draw bezier
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetLineWidth"; $PDF; 5 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.SetStrokeColor"; $PDF; 1; 0; 0 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.MoveTo"; $PDF; $x0; $y0 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.Bezier123"; $PDF; $x1; $y1; $x2; $y2; $x3; $y3 ) ]
                                                • Set Variable [ $r; Value:MBS( "DynaPDF.StrokePath"; $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: [Bezier3]
                                                              Script NameInitDynaPDF
                                                              Run script with full access privilegesOff
                                                              Include In MenuNo
                                                              Layouts that use this script
                                                                Scripts that use this script
                                                                Script Definition
                                                                Script Steps
                                                                • Set Variable [ $r; Value:MBS("Trace") ]
                                                                • #Locate DynaPDF library
                                                                • Set Variable [ $databasePath; Value:Get(FilePath) ]
                                                                • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                                                                • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                                                                • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                                                                • If [ Get(SystemPlatform) = -2 ]
                                                                • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dll" ) ]
                                                                • Else
                                                                • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dylib" ) ]
                                                                • End If
                                                                • #Initialize DynaPDF
                                                                • Set Variable [ $r; Value:MBS( "DynaPDF.Initialize"; $path) ]
                                                                • If [ $r ≠ "OK" ]
                                                                • Show Custom Dialog [ Title: "DynaPDF failed to initialize"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                • Else
                                                                • Set Variable [ $$DynaPDFInited; Value:1 ]
                                                                • End If
                                                                Fields used in this script
                                                                  Scripts used in this script
                                                                    Layouts used in this script
                                                                      Tables used in this script
                                                                        Table occurrences used by this script
                                                                          Custom Functions used by this script
                                                                            Custom menu set used by this script

                                                                              Download example: Create PDF with Bezier Curves

                                                                              Used functions:




                                                                              Links
                                                                              MBS Xojo PDF Plugins