Splits PDF document by pages

Namespace:  SautinSoft
Assembly:  SautinSoft.PdfVision (in SautinSoft.PdfVision.dll) Version: 5.1.2.13

Syntax

      
 C#  Visual Basic 
public int SplitPDFFileToPDFFolder(
	string SourceFile,
	string OutputPath
)
Public Function SplitPDFFileToPDFFolder ( _
	SourceFile As String, _
	OutputPath As String _
) As Integer

Parameters

SourceFile
String
Path to PDF file which you want to split by pages
OutputPath
String
Path to directory where to store each PDF page as single file after splitting

Return Value

0 - split successfully
1 - error, can't open input file
2 - error, output directory doesn't exist

Remarks



Examples

CopyHow to split PDF document using C#
using System;
using System.IO;
using System.Collections;

namespace Sample
{
    class Test
    {

        static void Main(string[] args)
        {
            // Split PDF document            
            SautinSoft.PdfVision v = new SautinSoft.PdfVision();
            //v.Serial = "XXXXXXXXXXXXXXX";

            //  Split PDF document by pages
            int ret = v.SplitPDFFileToPDFFolder(@"c:\source.pdf", @"c:\");

            //0 - split successfully
            //1 - error, can't open input file
            //2 - error, output directory doesn't exist

            if (ret == 0)
            {
                System.Console.WriteLine("Split successfully!");
            }

        }
    }
}
CopyHow to split PDF document using VB.Net
Imports System.IO

Namespace Sample
    Friend Class Test

        Shared Sub Main(ByVal args() As String)
            ' Split PDF document            
            Dim v As New SautinSoft.PdfVision()
            'v.Serial = "XXXXXXXXXXXXXXX";


            '  Split PDF document by pages
            Dim ret As Integer = v.SplitPDFFileToPDFFolder("c:\source.pdf", "c:\")

            '0 - split successfully
            '1 - error, can't open input file
            '2 - error, output directory doesn't exist


            If ret = 0 Then
                System.Console.WriteLine("Split successfully!")
            End If
        End Sub
    End Class
End Namespace

See Also