GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / HasInvisibleText Method
Example





In This Topic
HasInvisibleText Method (GdPicturePDF)
In This Topic
Checks if the currently selected page of the loaded PDF document contains any invisible text.
Syntax
'Declaration
 
Public Function HasInvisibleText() As Boolean
public bool HasInvisibleText()
public function HasInvisibleText(): Boolean; 
public function HasInvisibleText() : boolean;
public: bool HasInvisibleText(); 
public:
bool HasInvisibleText(); 

Return Value

true if the selected page of the loaded PDF document contains any invisible text, otherwise returns false. The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Example
How to check of the document contains any invisible text.
Using gdpicturePDF As New GdPicturePDF
    gdpicturePDF.LoadFromFile("input.pdf")
    Dim pageCount As Integer = gdpicturePDF.GetPageCount()
    Dim hasInvisibleText as Bool = False
    For i As Integer = 1 To pageCount
        hasInvisibleText = hasInvisibleText Or gdpicturePDF.HasInvisibleText()
    Next
    If hasInvisibleText Then
        MessageBox.Show("The document contains invisible text.", "GdPicturePDF")
    End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    gdpicturePDF.LoadFromFile("input.pdf");
    int pageCount = gdpicturePDF.GetPageCount();
    bool hasInvisibleText = false;
    for(int page = 1; page <= pageCount; i++)
    {
        hasInvisibleText = hasInvisibleText || gdpicturePDF.HasInvisibleText();
    }
    
    if(hasInvisibleText)
    {
        MessageBox.Show("The document contains invisible text.", "GdPicturePDF");
    }
}
See Also