Dim gdpicturePDF1 As New GdPicturePDF()
Dim gdpicturePDF2 As New GdPicturePDF()
If (gdpicturePDF1.LoadFromFile("test1.pdf", False) = GdPictureStatus.OK) AndAlso (gdpicturePDF2.LoadFromFile("test2.pdf", False) = GdPictureStatus.OK) Then
Dim oNewGdPicturePDF As GdPicturePDF = gdpicturePDF1.Merge2Documents(gdpicturePDF1, gdpicturePDF2)
'You can use also gdpicturePDF2 object to call the Merge2Documents method.
Dim status As GdPictureStatus = gdpicturePDF1.GetStat()
If status = GdPictureStatus.OK Then
oNewGdPicturePDF.SetAuthor("I'm the author of the merged document.")
If oNewGdPicturePDF.GetStat() = GdPictureStatus.OK Then
If oNewGdPicturePDF.SaveToFile("test_merged.pdf") = GdPictureStatus.OK Then
oNewGdPicturePDF.CloseDocument()
MessageBox.Show("Both documents have been successfully merged.", "Example: Merge2Documents")
Else
MessageBox.Show("The SaveToFile() method has failed.", "Example: Merge2Documents")
End If
End If
Else
MessageBox.Show("The Merge2Documents() method has failed with the status: " + status.ToString(), "Example: Merge2Documents")
End If
oNewGdPicturePDF.Dispose()
gdpicturePDF1.CloseDocument()
gdpicturePDF2.CloseDocument()
Else
MessageBox.Show("Loading of the source documents has failed.", "Example: Merge2Documents")
End If
gdpicturePDF1.Dispose()
gdpicturePDF2.Dispose()
GdPicturePDF gdpicturePDF1 = new GdPicturePDF();
GdPicturePDF gdpicturePDF2 = new GdPicturePDF();
if ((gdpicturePDF1.LoadFromFile("test1.pdf", false) == GdPictureStatus.OK) &&
(gdpicturePDF2.LoadFromFile("test2.pdf", false) == GdPictureStatus.OK))
{
GdPicturePDF oNewGdPicturePDF = gdpicturePDF1.Merge2Documents(gdpicturePDF1, gdpicturePDF2);
//You can use also gdpicturePDF2 object to call the Merge2Documents method.
GdPictureStatus status = gdpicturePDF1.GetStat();
if (status == GdPictureStatus.OK)
{
oNewGdPicturePDF.SetAuthor("I'm the author of the merged document.");
if (oNewGdPicturePDF.GetStat() == GdPictureStatus.OK)
{
if (oNewGdPicturePDF.SaveToFile("test_merged.pdf") == GdPictureStatus.OK)
{
oNewGdPicturePDF.CloseDocument();
MessageBox.Show("Both documents have been successfully merged.", "Example: Merge2Documents");
}
else
{
MessageBox.Show("The SaveToFile() method has failed.", "Example: Merge2Documents");
}
}
}
else
{
MessageBox.Show("The Merge2Documents() method has failed with the status: " + status.ToString(), "Example: Merge2Documents");
}
oNewGdPicturePDF.Dispose();
gdpicturePDF1.CloseDocument();
gdpicturePDF2.CloseDocument();
}
else
{
MessageBox.Show("Loading of the source documents has failed.", "Example: Merge2Documents");
}
gdpicturePDF1.Dispose();
gdpicturePDF2.Dispose();