How to convert web page to PDF from link for HTML to PDF ...

[Pages:3]

How to convert web page to PDF from link for HTML to PDF API in PowerShell and PDF.co Web API

Tutorial: how to convert web page to PDF from link for HTML to PDF API in PowerShell

Today you are going to learn how to convert web page to PDF from link in PowerShell. HTML to PDF API in PowerShell can be implemented with PDF.co Web API. PDF.co 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. The SDK samples like this one below explain how to quickly make your application do HTML to PDF API in PowerShell with the help of PDF.co Web API. Open your PowerShell project and simply copy & paste the code and then run your app! Enjoy writing a code with ready-to-use sample PowerShell codes to implement HTML to PDF API using PDF.co Web API. PDF.co Web API - free trial version is on available our website. Also, there are other code samples to help you with your PowerShell application included into trial version.

FOR MORE INFORMATION AND FREE TRIAL:

Download Free Trial SDK (on-premise version) Read more about PDF.co Web API Explore API Documentation Get Free Training for PDF.co Web API Get Free API key for Web API visit

Source Code Files:

ConvertWebPageToPdfFromLink.ps1

# The authentication key (API Key). # Get your own by registering at $API_KEY = "***********************************"

# URL of web page to convert to PDF document. $SourceUrl = "" # Destination PDF file name $DestinationFile = ".\result.pdf"

# Prepare URL for `Web Page to PDF` API call $query = "$(Split-Path $DestinationFile -Leaf $query = [System.Uri]::EscapeUriString($query)

try { # Execute request $jsonResponse = Invoke-RestMethod -Method Get -Headers @{ "x-api-key" = $API_KEY } -Uri $

if ($jsonResponse.error -eq $false) { # Get URL of generated PDF file $resultFileUrl = $jsonResponse.url;

# Download PDF file Invoke-WebRequest -Headers @{ "x-api-key" = $API_KEY } -OutFile $DestinationFile -Uri

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 "& .\ConvertWebPageToPdfFromLink.ps1" echo Script finished with errorlevel=%errorlevel%

pause

VIDEO



ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit PDF.co Web API Home Page Explore PDF.co Web API Documentation Explore Samples Sign Up for PDF.co Web API Online Training

ON-DEMAND REST WEB API

Get Your API Key Explore Web API Docs Explore Web API Samples

visit visit PDF.co



................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download