Dim caption As String = "Example: SetPageLabelsRangeStartPage"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
Dim rangesCount As Integer = gdpicturePDF.GetPageLabelsRangeCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If rangesCount > 0 Then
Dim pageCount As Integer = gdpicturePDF.GetPageCount()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SetPageLabelsRangeStartPage(0, pageCount)
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test_SetPageLabelsRangeStartPage.pdf") = GdPictureStatus.OK Then
MessageBox.Show("The starting page for the first labeling range has been reset successfully and the file has been saved.", caption)
Else
MessageBox.Show("The starting page for the first labeling range has been reset successfully, but the file can't be saved.", caption)
End If
Else
MessageBox.Show("The SetPageLabelsRangeStartPage() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("No page labeling ranges are defined in this PDF document.", caption)
End If
Else
MessageBox.Show("The GetPageLabelsRangeCount() 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: SetPageLabelsRangeStartPage";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
int rangesCount = gdpicturePDF.GetPageLabelsRangeCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (rangesCount > 0)
{
int pageCount = gdpicturePDF.GetPageCount();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SetPageLabelsRangeStartPage(0, pageCount);
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test_SetPageLabelsRangeStartPage.pdf") == GdPictureStatus.OK)
MessageBox.Show("The starting page for the first labeling range has been reset successfully and the file has been saved.", caption);
else
MessageBox.Show("The starting page for the first labeling range has been reset successfully, but the file can't be saved.", caption);
}
else
MessageBox.Show("The SetPageLabelsRangeStartPage() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The GetPageCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("No page labeling ranges are defined in this PDF document.", caption);
}
else
MessageBox.Show("The GetPageLabelsRangeCount() method has failed with the status: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();