Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.Rectangle
This function draws a rectangle.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
PosX | X-Coordinate of rectangle | $x |
PosY | Y-Coordinate of rectangle | $y |
Width | Width of the rectangle | $w |
Height | Height of the rectangle | $h |
FillMode | Fill mode. Can be FillNoClose, StrokeNoClose, FillStrokeNoClose, Fill, Stroke, FillStroke, FillEvOdd, FillStrokeEvOdd, FillEvOddNoClose, FillStrokeEvOddNoClose, NoFill or Close. | "fill" |
Result
Returns OK or error message.
Description
This function draws a rectangle.See also Rectangle function in DynaPDF manual.
Examples
Fills a rectangle:
MBS( "DynaPDF.Rectangle"; $PDF; 100; 200; 200; 200; "fill" )
Draws a rectangle:
MBS( "DynaPDF.Rectangle"; $PDF; 100; 200; 200; 200; "stroke" )
Find text and draw red rectangle around:
Set Variable [ $pos ; Value: MBS( "DynaPDF.FindText"; $pdf; Links::Text; 1) ]
If [ IsEmpty ( $pos ) ]
# not found
Else
# read positions
Set Variable [ $pos ; Value: Substitute($pos; " "; ¶) ]
Set Variable [ $x1 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 1)) ]
Set Variable [ $y1 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 2)) ]
Set Variable [ $x2 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 3)) ]
Set Variable [ $xy ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 4)) ]
Set Variable [ $x3 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 5)) ]
Set Variable [ $y3 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 6)) ]
Set Variable [ $x4 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 7)) ]
Set Variable [ $y4 ; Value: MBS( "Math.TextToNumber"; GetValue($pos; 8)) ]
Set Variable [ $w ; Value: MBS( "Math.TextToNumber"; $x3-$x1) ]
Set Variable [ $h ; Value: MBS( "Math.TextToNumber"; $y3-$y1) ]
#
# draw red rectangle
Set Variable [ $r ; Value: MBS( "DynaPDF.SaveGraphicState"; $pdf) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.SetStrokeColor"; $pdf; 1; 0; 0) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Rectangle"; $pdf; $x1; $y1; $w; $h; "stroke" ) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.RestoreGraphicState"; $pdf) ]
End If
See also
- DynaPDF.RestoreGraphicState
- DynaPDF.RotateCoords
- DynaPDF.Save
- DynaPDF.ScaleCoords
- DynaPDF.SetFillColor
- DynaPDF.SetStrokeColor
- DynaPDF.SkewCoords
- DynaPDF.Triangle
- DynaPDF.WriteText
- Math.TextToNumber
Example Databases
- Barcode/DynaPDF Barcode
- DynaPDF/Convert to 2 Pages
- DynaPDF/Coordinates
- DynaPDF/Create DeviceN ColorSpace
- DynaPDF/Create Text as PDFA
- DynaPDF/Page Layouting
- DynaPDF/Picture to PDF
- DynaPDF/Place Picture
- DynaPDF/Signature Appearance
- DynaPDF/Swiss QRCode
Blog Entries
- Add page links for FileMaker
- Things you can do with DynaPDF
- New in MBS FileMaker Plugin 11.0
- Adding cutting lines for PDF in FileMaker
- Swiss QR-Codes for invoices as vector graphics
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 15th March 2021