Reference Guide
GdPicture14 Namespace / GdPicturePDF Class / ApplyRedaction Method / ApplyRedaction() Method
Example





In This Topic
    ApplyRedaction() Method
    In This Topic
    Applies redactions based on regions added using the AddRedactionRegion method.
    Syntax
    'Declaration
     
    
    Public Overloads Function ApplyRedaction() As GdPictureStatus
    public GdPictureStatus ApplyRedaction()
    public function ApplyRedaction(): GdPictureStatus; 
    public function ApplyRedaction() : GdPictureStatus;
    public: GdPictureStatus ApplyRedaction(); 
    public:
    GdPictureStatus ApplyRedaction(); 

    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 oGdPicturePDF As New GdPicturePDF
        oGdPicturePDF.LoadFromFile("input.pdf")
        oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
        oGdPicturePDF.SelectPage(1)
        oGdPicturePDF.AddRedactionRegion(120, 300, 140, 20)
        oGdPicturePDF.SelectPage(2)
        oGdPicturePDF.AddRedactionRegion(100, 280, 70, 15)
        oGdPicturePDF.AddRedactionRegion(100, 310, 70, 15)
        oGdPicturePDF.ApplyRedaction()
        oGdPicturePDF.SaveToFile("output.pdf")
    End Using
    using (GdPicturePDF oGdPicturePDF = new GdPicturePDF())
    {
        oGdPicturePDF.LoadFromFile("input.pdf");
        oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
        oGdPicturePDF.SelectPage(1);
        oGdPicturePDF.AddRedactionRegion(120, 300, 140, 20);
        oGdPicturePDF.SelectPage(2);
        oGdPicturePDF.AddRedactionRegion(100, 280, 70, 15);
        oGdPicturePDF.AddRedactionRegion(100, 310, 70, 15);
        oGdPicturePDF.ApplyRedaction();
        oGdPicturePDF.SaveToFile("output.pdf");
    }
    See Also