Link Search Menu Expand Document

Split PDF Document - C#

PDF SDK sample in C# demonstrating ‘Split PDF Document’

using System.Diagnostics;
using Bytescout.PDF;

namespace SplitDocument
    class Program
        static void Main(string[] args)
            // Open first document
            Document document1 = new Document("document1.pdf");
            document1.RegistrationName = "demo";
            document1.RegistrationKey = "demo";

            // Create result document that will contain only required pages
            Document document2 = new Document();
            document2.RegistrationName = "demo";
            document2.RegistrationKey = "demo";
            // Add 1st and 3rd pages of the first document to the result document

            // Save result document

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf");
            processStartInfo.UseShellExecute = true;

Download Source Code (.zip)

Return to the previous page Explore PDF SDK