AddRedactionRegion(Single,Single,Single,Single,Byte,Byte,Byte,Byte) Method
In This Topic
Adds redaction region on the selected page of the loaded PDF document.
Syntax
'Declaration
Public Overloads Function AddRedactionRegion( _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte _
) As GdPictureStatus
public GdPictureStatus AddRedactionRegion(
float ,
float ,
float ,
float ,
byte ,
byte ,
byte ,
byte
)
public function AddRedactionRegion(
: Single;
: Single;
: Single;
: Single;
: Byte;
: Byte;
: Byte;
: Byte
): GdPictureStatus;
public function AddRedactionRegion(
: float,
: float,
: float,
: float,
: byte,
: byte,
: byte,
: byte
) : GdPictureStatus;
public: GdPictureStatus AddRedactionRegion(
float ,
float ,
float ,
float ,
byte ,
byte ,
byte ,
byte
)
public:
GdPictureStatus AddRedactionRegion(
float ,
float ,
float ,
float ,
byte ,
byte ,
byte ,
byte
)
Parameters
- Left
- The horizontal (X) coordinate of the closest point to the currently defined origin, where the redaction bounding box is to be located.
The value is expressed in the current units specified by the SetMeasurementUnit method .
- Top
- The vertical (Y) coordinate of the closest point to the currently defined origin, where the redaction bounding box is to be located.
The value is expressed in the current units specified by the SetMeasurementUnit method and it is related to the current page.
- Width
- The width of the redaction bounding box, expressed in the current units specified by the SetMeasurementUnit method.
- Height
- The height of the redaction bounding box, expressed in the current units specified by the SetMeasurementUnit method.
- Red
- The amount of red color to be used for the resulting region color. Use the value between 0 and 255.
- Green
- The amount of green color to be used for the resulting region color. Use the value between 0 and 255.
- Blue
- The amount of blue color to be used for the resulting region color. Use the value between 0 and 255.
- Alpha
- The transparency value of the resulting region color. Use the value between 0 (full transparency) and 255 (full opacity).
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Example
How to redact regions on pages in PDF document.
Using gdpicturePDF As New GdPicturePDF
gdpicturePDF.LoadFromFile("input.pdf")
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
gdpicturePDF.SelectPage(1)
gdpicturePDF.AddRedactionRegion(120, 300, 140, 20, 255, 0, 0, 255)
gdpicturePDF.SelectPage(2)
gdpicturePDF.AddRedactionRegion(100, 280, 70, 15, 0, 255, 0, 10)
gdpicturePDF.AddRedactionRegion(100, 310, 70, 15, 0, 0, 255, 150)
gdpicturePDF.ApplyRedaction()
gdpicturePDF.SaveToFile("output.pdf")
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
gdpicturePDF.LoadFromFile("input.pdf");
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
gdpicturePDF.SelectPage(1);
gdpicturePDF.AddRedactionRegion(120, 300, 140, 20, 255, 0, 0, 255);
gdpicturePDF.SelectPage(2);
gdpicturePDF.AddRedactionRegion(100, 280, 70, 15, 0, 255, 0, 10);
gdpicturePDF.AddRedactionRegion(100, 310, 70, 15, 0, 0, 255, 150);
gdpicturePDF.ApplyRedaction();
gdpicturePDF.SaveToFile("output.pdf");
}
Example
How to redact regions on pages in PDF document.
Using gdpicturePDF As New GdPicturePDF
gdpicturePDF.LoadFromFile("input.pdf")
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
gdpicturePDF.SelectPage(1)
gdpicturePDF.AddRedactionRegion(120, 300, 140, 20, 255, 0, 0, 255)
gdpicturePDF.SelectPage(2)
gdpicturePDF.AddRedactionRegion(100, 280, 70, 15, 0, 255, 0, 10)
gdpicturePDF.AddRedactionRegion(100, 310, 70, 15, 0, 0, 255, 150)
gdpicturePDF.ApplyRedaction()
gdpicturePDF.SaveToFile("output.pdf")
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
gdpicturePDF.LoadFromFile("input.pdf");
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
gdpicturePDF.SelectPage(1);
gdpicturePDF.AddRedactionRegion(120, 300, 140, 20, 255, 0, 0, 255);
gdpicturePDF.SelectPage(2);
gdpicturePDF.AddRedactionRegion(100, 280, 70, 15, 0, 255, 0, 10);
gdpicturePDF.AddRedactionRegion(100, 310, 70, 15, 0, 0, 255, 150);
gdpicturePDF.ApplyRedaction();
gdpicturePDF.SaveToFile("output.pdf");
}
See Also