A-PDF :: Affordable PDF Tools

Can I write code for splitting PDF with results from a VB.NET application?

Return KB main page

Question

I often run process in a command window with result show, but how to get result code from my VB.NET application?

Solution

A-PDF Split Command Line (Buy here) will help you to split large PDF file into with command line.

And here is the code for you to get split result from VB.NET:

Dim PSCmd As String = "c:\PSCMD\PSCMD.exe"
Dim PSCmdArgs As String = "-B """ & g_TempFolder & "SplitOutput\"" {basename}_{part:0000}_{bookmark} -HN"
Dim p As New System.Diagnostics.ProcessStartInfo
Dim MyProcess As System.Diagnostics.Process = Nothing

p.FileName = PSCmd
p.Arguments = """" & g_TempFolder & FileName & """ " & PSCmdArgs
p.WindowStyle = ProcessWindowStyle.Hidden

MyProcess = System.Diagnostics.Process.Start(p)

MyProcess.WaitForExit()

'Check the ExitCode - 0 means success
If MyProcess.ExitCode <> 0 Then
Throw New Exception("PSCMD returned code: " & MyProcess.ExitCode & " during PDF Split")
End If

You can view the whole usage about A-PDF Split Command Line in this webpage.

Related products

We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.

Return KB main page