Example





In This Topic
GdPicture14 Namespace / GdPicturePDF Class / RemoveAllText Method

RemoveAllText Method (GdPicturePDF)

In This Topic
Removes all text on currently selected page of the loaded PDF document.
Syntax
'Declaration
 
Public Function RemoveAllText() As GdPictureStatus
public GdPictureStatus RemoveAllText()
public function RemoveAllText(): GdPictureStatus; 
public function RemoveAllText() : GdPictureStatus;
public: GdPictureStatus RemoveAllText(); 
public:
GdPictureStatus RemoveAllText(); 

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 remove all text from the document.
Using gdpicturePDF As New GdPicturePDF
    gdpicturePDF.LoadFromFile("input.pdf")
    Dim pageCount As Integer = gdpicturePDF.GetPageCount()
    For page As Integer = 1 To pageCount
        gdpicturePDF.SelectPage(page)
        gdpicturePDF.RemoveAllText()
    Next
    gdpicturePDF.SaveToFile("output.pdf")
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    gdpicturePDF.LoadFromFile("input.pdf");
    int pageCount = gdpicturePDF.GetPageCount();
    for(int page = 1; page <= pageCount; i++)
    {
        gdpicturePDF.SelectPage(page);
        gdpicturePDF.RemoveAllText();
    }
    gdpicturePDF.SaveToFile("output.pdf");
}
See Also