#1
Posted
:
Monday, November 20, 2017 4:27:53 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 89
Was thanked: 4 time(s) in 4 post(s)
LEADTOOLS has a simple method call that will allow you to combine PDFs into a singular document.
Both of the attached console applications utilize the latest from LEADTOOLS v20.
C#Code:using Leadtools;
using Leadtools.Codecs;
using Leadtools.Pdf;
namespace simplePDFMerge_20
{
class Program
{
static void Main(string[] args)
{
//set your license file here
RasterSupport.SetLicense("", "");
string pdf1 = @"C:\Users\cthompson\Desktop\Leadtools.pdf";
string pdf2 = @"C:\Users\cthompson\Desktop\Leadtools.pdf";
string pdf3 = @"C:\Users\cthompson\Desktop\Leadtools.pdf";
string destinationFilePath = @"C:\Users\cthompson\Desktop\combinedTest.pdf";
const string pdfEngineLocation = @"D:\LEAD15\Dist\Bin20\Dotnet4\Win32"; //file path of the Leadtools.pdfengine.dll
RasterCodecs codecs = new RasterCodecs();
codecs.Options.Pdf.InitialPath = pdfEngineLocation;
PDFFile pdfFile = new PDFFile(pdf1);
pdfFile.MergeWith(new string[] { pdf2, pdf3 }, destinationFilePath);
}
}
}
VBCode:Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Pdf
Module Module1
Sub Main()
'Enter you license and ke files here
RasterSupport.SetLicense("", "")
Dim pdf1 As String = "C:\Users\cthompson\Desktop\Leadtools.pdf"
Dim pdf2 As String = "C:\Users\cthompson\Desktop\Leadtools.pdf"
Dim pdf3 As String = "C:\Users\cthompson\Desktop\Leadtools.pdf"
Dim destinationFilePath As String = "C:\Users\cthompson\Desktop\merge.pdf"
Const pdfEngineLocation As String = "D:\LEAD15\Dist\Bin20\Dotnet4\Win32"
Dim codecs = New RasterCodecs()
codecs.Options.Pdf.InitialPath = pdfEngineLocation
Dim pdfFile = New PDFFile(pdf1)
pdfFile.MergeWith(New String() {pdf2, pdf3}, destinationFilePath)
End Sub
End Module
Below for download are the two simple C# and VB PDF MergeWith applications that are demonstrated above.
C#VBChris Thompson
Developer Support Engineer
LEAD Technologies, Inc.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.