How to split PDF from URL for PDF splitting API in VB.NET with Web API

Step By Step Tutorial: how to split PDF from URL for PDF splitting API in VB.NET

The coding tutorials are designed to help you test the features without need to write your own code. Web API helps with PDF splitting API in VB.NET. Web API is the flexible Web API that includes full set of functions from e-signature requests to data extraction, OCR, images recognition, pdf splitting and pdf splitting. Can also generate barcodes and read barcodes from images, scans and pdf.

Fast application programming interfaces of Web API for VB.NET plus the instruction and the code below will help to learn how to split PDF from URL. Sample code in VB.NET is all you need. Copy-paste it to your the code editor, then add a reference to Web API and you are ready to try it! Enjoy writing a code with ready-to-use sample VB.NET codes to implement PDF splitting API using Web API.

Trial version of ByteScout is available for free download from our website. This and other source code samples for VB.NET and other programming languages are available.

Try Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Imports System.IO Imports System.Net Imports Newtonsoft.Json.Linq Module Module1 ' The authentication key (API Key). ' Get your own by registering at Const API_KEY As String = "***********************************" ' Source PDF file to split Const SourceFileUrl As String = "" ' Comma-separated list of page numbers (or ranges) to process. Example: '1,3-5,7-'. const Pages as String = "1-2,3-" Sub Main() ' Create standard .NET web client instance Dim webClient As WebClient = New WebClient() ' Set API Key webClient.Headers.Add("x-api-key", API_KEY) ' Prepare URL for `Split PDF` API call Dim query As String = Uri.EscapeUriString(String.Format( "{0}&url={1}", Pages, SourceFileUrl)) Try ' Execute request Dim response As String = webClient.DownloadString(query) ' Parse JSON response Dim json As JObject = JObject.Parse(response) If json("error").ToObject(Of Boolean) = False Then ' Download generated PDF files Dim part As Integer = 1 For Each token As JToken In json("urls") Dim resultFileUrl As string = token.ToString() Dim localFileName As String = String.Format(".\part{0}.pdf", part) webClient.DownloadFile(resultFileUrl, localFileName) Console.WriteLine("Downloaded ""{0}"".", localFileName) part = part + 1 Next Else Console.WriteLine(json("message").ToString()) End If Catch ex As WebException Console.WriteLine(ex.ToString()) End Try webClient.Dispose() Console.WriteLine() Console.WriteLine("Press any key...") Console.ReadKey() End Sub End Module

Try Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" /> </packages>

Try Web API today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)



Get 60 Day Free Trial or Visit Web API Home Page

Explore Web API Documentation

Get Web API Free Training


Get Your Free API Key

Explore Web API Documentation

Related Samples: