Dim caption As String = "Example: RemovePageLink"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("links.pdf", False)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SelectPage(1)
If status = GdPictureStatus.OK Then
Dim linksCount As Integer = gdpicturePDF.GetPageLinksCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
If linksCount > 0 Then
status = gdpicturePDF.RemovePageLink(0)
If status = GdPictureStatus.OK Then
MessageBox.Show("The first link on the first page has been removed successfully.", caption)
If gdpicturePDF.SaveToFile("linksFirstRemoved.pdf") = GdPictureStatus.OK Then
MessageBox.Show("The file has been saved successfully.", caption)
Else
MessageBox.Show("The file can't be saved.", caption)
End If
Else
MessageBox.Show("The RemovePageLink() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("This page has no links.", caption)
End If
Else
MessageBox.Show("The GetPageLinksCount() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: RemovePageLink";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("links.pdf", false);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SelectPage(1);
if (status == GdPictureStatus.OK)
{
int linksCount = gdpicturePDF.GetPageLinksCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
if (linksCount > 0)
{
status = gdpicturePDF.RemovePageLink(0);
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The first link on the first page has been removed successfully.", caption);
if (gdpicturePDF.SaveToFile("linksFirstRemoved.pdf") == GdPictureStatus.OK)
{
MessageBox.Show("The file has been saved successfully.", caption);
}
else
{
MessageBox.Show("The file can't be saved.", caption);
}
}
else
{
MessageBox.Show("The RemovePageLink() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("This page has no links.", caption);
}
}
else
{
MessageBox.Show("The GetPageLinksCount() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The SelectPage() method has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The file can't be loaded.", caption);
}
gdpicturePDF.Dispose();