Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#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.

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);

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.
File Attachment(s):
simplePDFMerge_20.zip (44kb) downloaded 153 time(s).

File Attachment(s):
simplePDFMergeVB_20.zip (50kb) downloaded 116 time(s).
Chris Thompson
Developer Support Engineer
LEAD Technologies, Inc.


Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.037 seconds.