Merge2Documents(String,String,String) Method
Merges two PDF documents according to their file paths. The resulting PDF document is saved to a file path you have specified. If the specified file already exists, it will be overwritten. Please see also the
GdPicturePDF.Merge2Documents method for more details.
Just to inform you, that the toolkit offers the adaptive file caching mechanism to significantly reduce memory usage while merging large documents. The feature is available in both 32-bit and 64-bit mode by default.
public function Merge2Documents(
: String;
: String;
: String
): GdPictureStatus;
public function Merge2Documents(
: String,
: String,
: String
) : GdPictureStatus;
'Declaration
Public Overloads Function Merge2Documents( _
ByVal As String, _
ByVal As String, _
ByVal As String _
) As GdPictureStatus
Parameters
- SrcDoc1
- The file path of the first PDF document to merge.
- SrcDoc2
- The file path of the second PDF document to merge.
- DstDoc
- The file path of the destination PDF document.
Please ensure that the destination file path differs from both source file paths.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
How to merge two PDF documents using their file paths into a PDF document specified by its file path.
Using gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.Merge2Documents("test1.pdf", "test2.pdf", "test_merged.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("Both documents have been successfully merged.", "Example: Merge2Documents")
Else
MessageBox.Show("The Merge2Documents() method has failed with the status: " + status.ToString(), "Example: Merge2Documents")
End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
GdPictureStatus status = gdpicturePDF.Merge2Documents("test1.pdf", "test2.pdf", "test_merged.pdf");
if (status == GdPictureStatus.OK)
{
MessageBox.Show("Both documents have been successfully merged.", "Example: Merge2Documents");
}
else
{
MessageBox.Show("The Merge2Documents() method has failed with the status: " + status.ToString(), "Example: Merge2Documents");
}
}