Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Deletes text in the area.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 14.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
The PDF reference. | ||
Left | The left coordinate of the rectangle. | 0 |
Bottom | The bottom coordinate of the page. | 0 |
Right | The right coordinate of the page. | 595 |
Top | The top coordinate of the page. | 842 |
Returns 1, 0 or error.
Delete a rectangle in text:
# initialize parser
Set Variable [ $OptimizeFlags ; Value: 0 ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.Create"; $pdf; $OptimizeFlags ) ]
#
# Now parse a page
Set Variable [ $r ; Value: MBS("DynaPDF.Parser.ParsePage"; $pdf; 1; "EnableTextSelection") ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to parse page" ; $r ]
Else
# Define the rectangle
Set Variable [ $areaLeft ; Value: 200 ]
Set Variable [ $areaWidth ; Value: 200 ]
Set Variable [ $areaTop ; Value: 200 ]
Set Variable [ $areaHeight ; Value: 200 ]
#
# we need right and bottom. And since coordinates are bottom-up, we bottom is the smaller y value
Set Variable [ $areaRight ; Value: $areaLeft + $areaWidth ]
Set Variable [ $areaBottom ; Value: $areaTop ]
Set Variable [ $areaTop ; Value: $areaTop + $areaHeight ]
#
# now delete text in that area
Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.DeleteText"; $pdf; $areaTop; $areaBottom; $areaLeft; $areaRight) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to parse page" ; $r ]
Else
# Save changes back
Set Variable [ $r ; Value: MBS( "DynaPDF.Parser.WriteToPage"; $pdf; $OptimizeFlags) ]
End If
End If
This function checks for a license.
Created 23th November 2023, last changed 23th November 2023