XDoc.PDF
Features
Tech Specs
How-to C#
Pricing
How to Start Convert PDF Read PDF Build PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

C# PDF SDK Library
How to merge, split, separate Adobe PDF file pages into multiple PDF files using C#.net


High quality PDF document splitter and cutter: full C# souce code to split PDF document apart in Visual C#.NET Application. Online Free Trial Download.










  • Best .NET PDF SDK control for splitting PDF document in Visual C# .NET project
  • High quality PDF separator and breaker component for integration and splitting PDF file in both .NET WinForm console application and ASP.NET project
  • C#.NET class source code for splitting PDF document in multiple methods in Visual Studio .NET program
  • Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
  • Able to split PDF document in preview on webpage in ASP.NET
  • C# PDF splitter & cutter library for breaking PDF file into two or multiple files in .NET framework
  • Support to break a large PDF file into smaller files
  • Separate PDF file into single ones with defined pages
  • Divide PDF file into multiple files by outputting PDF file size
  • Split PDF document by PDF bookmark and outlines




C# PDF document splitting library control, XDoc.PDF, provides an advanced C# programming way to split PDF document into smaller PDF files in .NET developing applications. Using this C#.NET PDF document splitting library control, C# developers can easily and accurately disassemble multi-page PDF document into two or more separate PDF document files by page(s).

RasterEdge Visual C# .NET PDF document splitter control toolkit SDK can not only offer C# developers a professional .NET solution to split PDF document file but also provide them the ability to name outputted PDF document files with a customized name pattern using a few lines of simple Visual C# code.

This C#.NET PDF document splitting library control offers developers an efficient PDF document splitting approach, using which C# developers can split target PDF document file by specifying a page or pages. If needed, developers can also combine generated split PDF document files with other PDF files to form a new PDF file using RasterEdge XDoc.PDF. Besides, in the process of splitting PDF document, developers can also remove certain PDF page from target PDF file using C#.NET PDF page deletion API.

Please note, PDF file will be divided from the previous page of your defined page number which starts from 0. For example, your original PDF file contains 4 pages. If your page number is set as 1, then the two output PDF files will contains the first page and the later three pages respectively.





Split a PDF file to two files using C#


String inputFilePath = Program.RootPath + "\\" + "1.pdf";
String outputFileName = "Output";
int splitIndex = 1;     //  valid value: 1 to (Page Count - 1)

List<String> outputFilePaths = new List<String>();
outputFilePaths.Add(Program.RootPath + "\\" + outputFileName + "_0.pdf");
outputFilePaths.Add(Program.RootPath + "\\" + outputFileName + "_1.pdf");

//  split input file to 2 files, a file contains the first page of the input file,
//  and another file contains all remained pages.
PDFDocument.SplitDocument(inputFilePath, splitIndex, outputFilePaths.ToArray());







C#: quick to break, divide pdf document into multiple pdf files

        #region quick to split pdf document into multiple pdf files
        internal static void splitPdfFile()
        {
            String inputFilePath = @"C:\source.pdf";
            //Page indexes to devide pdf document
            int[] pageIndexes = new int[] { 2, 3 };
            String firstFile = @"C:\part_1.pdf";
            String secondFile = @"C:\part_2.pdf";
            String thirdFile = @"C:\part_3.pdf";
            //Split input file to 3 files.
            //File 0: page 0 ~ 1
            //File 1: page 2
            //File 2: page 3 ~
            String[] outputFiles = new String[] { firstFile, secondFile, thirdFile };
            PDFDocument.SplitDocument(inputFilePath, pageIndexes, outputFiles);
        }
        #endregion







Separate PDF document advanced settings

Use XDoc.PDF SDK document splitter functions to separate one or more PDFs into multiple PDF documents by setting the number of pages, output PDF file size, or PDF bookmarks.







C# split, divide PDF document by number of pages

        #region Split PDF document by number of pages
        internal static void splitPdfFileByPageNumber()
        {
            String inputFilePath = @"C:\1.pdf";

            //  set split option
            SplitOptions options = new SplitOptions(SplitMode.ByPage);
            //  limit the pages of each file to 8 pages
            options.MaxPages = 8;
            //  set output option
            SplitOutputOptions outputOps = new SplitOutputOptions();
            outputOps.OutputFolder = @"C:\output\";
            outputOps.Mode = 2;
            outputOps.Label = @"Part";
            outputOps.Separator = '_';
            //  split a PDF file with options
            PDFDocument.SplitDocument(inputFilePath, options, outputOps);
        }
        #endregion





C# cut, break pdf file by output file size

        #region split pdf file by output file size
        internal static void splitPdfFileBySize()
        {
            String inputFilePath = @"C:\1.pdf";
            //set split option.
            SplitOptions options = new SplitOptions(SplitMode.BySize);
            //limit the size of each file to 0.03M.
            options.MaxSize = 0.03F;
            //set output option.
            SplitOutputOptions outputOps = new SplitOutputOptions();
            outputOps.OutputFolder = @"C:\output\";
            outputOps.Mode = 1;
            outputOps.Label = @"splitByFileSizePart";
            outputOps.Separator = '_';
            //split a PDF file with options.
            PDFDocument.SplitDocument(inputFilePath, options, outputOps);
        }
        #endregion





C# split, divide pdf file by top level bookmarks

        #region split pdf file by top level bookmarks
        internal static void splitPdfFileByBookmarks()
        {
            String inputFilePath = @"C:\2.pdf";

            //  set split option
            SplitOptions options = new SplitOptions(SplitMode.ByBookMark);
            //  set output option
            SplitOutputOptions outputOps = new SplitOutputOptions();
            outputOps.OutputFolder = @"C:\output\";
            outputOps.Mode = 2;
            outputOps.Label = @"Part";
            outputOps.Separator = '_';
            //  split a PDF file with options
            PDFDocument.SplitDocument(inputFilePath, options, outputOps);
        }
        #endregion