ByteScout Cloud API Server - PDF Merging API - PowerShell - Merge PDF Documents From URLs - ByteScout

ByteScout Cloud API Server – PDF Merging API – PowerShell – Merge PDF Documents From URLs

  • Home
  • /
  • Articles
  • /
  • ByteScout Cloud API Server – PDF Merging API – PowerShell – Merge PDF Documents From URLs

How to merge PDF documents from urls for PDF merging API in PowerShell using ByteScout Cloud API Server

ByteScout Cloud API Server is API server that is ready to use and can be installed and deployed in less than 30 minutes on your own Windows server or server in a cloud. It can save data and files on your local server-based file storage or in Amazon AWS S3 storage. Data is processed solely on the API server and is powered by ByteScout engine, no cloud services or Internet connection is required for data processing..

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

MergePdfDocumentsFromUrls.ps1

      
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". # If it's not then please replace this with with your hosting url. # Direct URLs of PDF documents to merge $SourceFiles = @( "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf", "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf" ) # Destination PDF file name $DestinationFile = ".\result.pdf" # Prepare URL for `Merge PDF` API call $query = "https://localhost/pdf/merge?name={0}&url={1}" -f ` $(Split-Path $DestinationFile -Leaf), $($SourceFiles -join ",") $query = [System.Uri]::EscapeUriString($query) try { # Execute request $jsonResponse = Invoke-RestMethod -Method Get -Uri $query if ($jsonResponse.error -eq $false) { # Get URL of generated PDF file $resultFileUrl = $jsonResponse.url; # Download PDF file Invoke-WebRequest -OutFile $DestinationFile -Uri $resultFileUrl Write-Host "Generated PDF file saved as `"$($DestinationFile)`" file." } else { # Display service reported error Write-Host $jsonResponse.message } } catch { # Display request error Write-Host $_.Exception }

run.bat

      
@echo off powershell -NoProfile -ExecutionPolicy Bypass -Command "& .\MergePdfDocumentsFromUrls.ps1" echo Script finished with errorlevel=%errorlevel% pause

VIDEO

ON-PREMISE OFFLINE SDK

Get 60 Day Free Trial

See also:

ON-DEMAND REST WEB API

Get Your API Key

See also:

Tutorials:

prev
next