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





In This Topic
IsTagged Method (GdPicturePDF)
In This Topic
Checks whether the currently loaded PDF document conforms to Tagged PDF conventions.
Syntax
'Declaration
 
Public Function IsTagged() As Boolean
public bool IsTagged()
public function IsTagged(): Boolean; 
public function IsTagged() : boolean;
public: bool IsTagged(); 
public:
bool IsTagged(); 

Return Value

true if the current PDF conforms to Tagged PDF conventions based on the information in MarkInfo dictionary, otherwise false. The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Remarks
It is recommend to use the GdPicturePDF.GetStat method to identify the specific reason for the method's failure, if any.
Example
How to determine if the PDF document is a tagged PDF file.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
    Dim isTagged As Boolean = gdpicturePDF.IsTagged()
    status = gdpicturePDF.GetStat()
    If status = GdPictureStatus.OK Then
        If isTagged Then
            MessageBox.Show("Your PDF document is tagged.", "Example: IsTagged")
        Else
            MessageBox.Show("Your PDF document is not tagged.", "Example: IsTagged")
        End If
    Else
        MessageBox.Show("The IsTagged() method has failed with the status: " + status.ToString(), "Example: IsTagged")
    End If
Else
    MessageBox.Show("The file can't be loaded.", "Example: IsTagged")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
    bool isTagged = gdpicturePDF.IsTagged();
    status = gdpicturePDF.GetStat();
    if (status == GdPictureStatus.OK)
    {
        if (isTagged)
        {
            MessageBox.Show("Your PDF document is tagged.", "Example: IsTagged");
        }
        else
        {
            MessageBox.Show("Your PDF document is not tagged.", "Example: IsTagged");
        }
    }
    else
    {
        MessageBox.Show("The IsTagged() method has failed with the status: " + status.ToString(), "Example: IsTagged");
    }
}
else
{
    MessageBox.Show("The file can't be loaded.", "Example: IsTagged");
}
gdpicturePDF.Dispose();
See Also