GetTitle Method (GdPicturePDF)
Returns the title of the currently loaded PDF document, if any is set in the document information dictionary.
public function GetTitle(): String;
public function GetTitle() : String;
public: string* GetTitle();
public:
String^ GetTitle();
'Declaration
Public Function GetTitle() As String
Return Value
The value of the document's Title property as a string. The
GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
How to find out the title of the PDF document.
Using gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim title As String = gdpicturePDF.GetTitle()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("The title of this PDF is: " + title, "Example: GetTitle")
Else
MessageBox.Show("The GetTitle() method has failed with the status: " + status.ToString(), "Example: GetTitle")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetTitle")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
string title = gdpicturePDF.GetTitle();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The title of this PDF is: " + title, "Example: GetTitle");
}
else
{
MessageBox.Show("The GetTitle() method has failed with the status: " + status.ToString(), "Example: GetTitle");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetTitle");
}
}