Dim caption As String = "Example: DuplicatePage"
Dim gdpicturePDF As New GdPicturePDF()
If gdpicturePDF.LoadFromFile("testPDF.pdf", False) = GdPictureStatus.OK Then
Dim count As Integer = gdpicturePDF.GetPageCount()
Dim status As GdPictureStatus = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If count > 0 Then
status = gdpicturePDF.SelectPage(1)
If status = GdPictureStatus.OK Then
status = gdpicturePDF.DuplicatePage(3)
If status = GdPictureStatus.OK Then
Dim current As Integer = gdpicturePDF.GetCurrentPage()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SaveToFile("test_DuplicatePage.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("The example HAS been followed successfully." + vbCrLf +
"The current page before the page duplication was: 1 " + vbCrLf +
"The current page after the page duplication is: " + current.ToString(), caption)
End If
End If
Else
MessageBox.Show("The DuplicatePage() method has failed with the status: " + status.ToString(), caption)
status = GdPictureStatus.OK
End If
End If
End If
End If
If status <> GdPictureStatus.OK Then
MessageBox.Show("The example HAS NOT been followed successfully. The last error status is: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: DuplicatePage";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetPageCount();
GdPictureStatus status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if (count > 0)
{
status = gdpicturePDF.SelectPage(1);
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.DuplicatePage(3);
if (status == GdPictureStatus.OK)
{
int current = gdpicturePDF.GetCurrentPage();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SaveToFile("test_DuplicatePage.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("The example HAS been followed successfully.\nThe current page before the page duplication was: 1 \n" +
"The current page after the page duplication is: " + current.ToString(), caption);
}
}
else
{
MessageBox.Show("The DuplicatePage() method has failed with the status: " + status.ToString(), caption);
status = GdPictureStatus.OK;
}
}
}
}
if (status != GdPictureStatus.OK)
MessageBox.Show("The example HAS NOT been followed successfully. The last error status is: " + status.ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();