---
title: "URL to PDF | ScreenshotAPI.net"
slug: "/url-to-pdf"
description: "Easily convert any webpage URL into a high-quality PDF with ScreenshotAPI.net. Perfect for reports, documentation, or multi-page captures."
---

# Transform any URL into PDF

Generate high-quality PDF documents from any webpage with pixel-perfect precision. Ideal for reports, documentation, archives, and professional document creation.

## Powerful Features

Unlock advanced capabilities to capture, customize, and optimize screenshots and PDFs for diverse use cases

### Format

Choose output format options such as PDF/A, standard PDF, or optimized web PDF for smaller file sizes.

### Orientation

Select Landscape or Portrait to match the layout needs of your document.

### Page Range

Capture specific pages or a full multi-page conversion (e.g., 1–5, all).

### Print Background

Option to include or exclude background graphics when rendering for print-like fidelity.

## PDF Generation Formats

Choose from a wide range of industry-standard formats like A2, A3, A4, A5, Letter, Legal, Tabloid, and Ledger to match your printing and publishing needs

## Easy Integration

Seamlessly connect with your existing workflows, applications, and platforms using simple APIs and flexible configuration options

```js

const axios = require("axios");

let config = {
	method: "get",
	maxBodyLength: Infinity,
	url: "https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3",
	headers: { }
};

axios.request(config).then((response) => {
	console.log(JSON.stringify(response.data));
}.catch((error) => {
	console.log(error);
});
```

```php

<?php
	$client = new http.Client;
	$request = new http.Client.Request;
	$request->setRequestUrl("https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3");
	$request->setRequestMethod("GET");
	$request->setOptions(array());

	$client->enqueue($request)->send();
	$response = $client->getResponse();
	echo $response->getBody();
?>
```

```go

package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {
	url := "https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3"
	method := "GET"

	client := &http.Client { }
	req, err := http.NewRequest(method, url, nil)

	if err != nil {
		fmt.Println(err)
		return
	}

	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}

	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
```

```java

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder().url("https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3"
	.method("GET", body)
	.build();
Response response = client.newCall(request)
	.execute();
```

```py

import requests

url = "https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3"
payload = {}
headers = {}

response = requests.request("GET", url, headers, data=payload)
print(response.text)
```

```ruby

require "uri"
require "net/http"

url = URI("https://shot.screenshotapi.net/v3/screenshot?token={token}&url=https://apple.com&file_type=pdf&pdf_options%5Bformat%5D)=A4&pdf_options%5Bmedia%5D)=print&pdf_options%5Blandscape%5D)=false&pdf_options%5Bprint_background%5D)=false&pdf_options%5Bpage_range%5D)=2-3")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body
```

## PDF Generation Use Cases

Transform any web content into professional PDF documents for various business needs

### Document Reports

Automated document generation for daily reports, invoices, and business summaries with consistent formatting.

### Analytics Export

Convert web analytics, dashboards, and data visualizations into professional PDF reports for stakeholders.

### Archive Creation

Create PDF archives of web content, ensuring long-term document preservation and offline accessibility.
