PDF Generation SDKs

cloudlayer.io provides official PDF generation SDKs for .NET (C# and F#), Go, Java, JavaScript/TypeScript, PHP, Python, and Ruby. Convert HTML to PDF, capture URLs as documents, and render templates from your application. Since all document generation is driven by a REST API, you can also integrate directly from any language that supports HTTP requests.

Official SDKs

LanguagePackageSource
.NET C#NuGetGitHub
Gopkg.go.devGitHub
JavaMaven CentralGitHub
JavaScript / TypeScriptnpmGitHub
PHPPackagistGitHub
PythonPyPIGitHub
RubyRubyGemsGitHub
.NET F#NuGetGitHub

Clients in development

Rust and Swift clients exist as source on GitHub and are not yet published to a package manager: Rust and Swift. Until they ship, call the REST API directly from those languages.

Using the REST API Directly

The cloudlayer.io REST API can be called from any language. All you need is:

  1. Your API key (passed via the X-API-Key header)
  2. The ability to make HTTP POST requests with JSON bodies
  3. Base URL: https://api.cloudlayer.io/v2

Quick Reference: API Endpoints

EndpointDescription
POST /url/pdfConvert a URL to PDF
POST /url/imageConvert a URL to an image
POST /html/pdfConvert HTML to PDF
POST /html/imageConvert HTML to an image
POST /template/pdfGenerate a PDF from a template
POST /template/imageGenerate an image from a template
GET /url/pdfSimple URL to PDF (query params only)
GET /url/imageSimple URL to image (query params only)

cURL Example

curl --request POST \
  --url https://api.cloudlayer.io/v2/url/pdf \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <YOUR-API-KEY>' \
  --data '{
    "url": "https://example.com",
    "async": false
  }'

JavaScript (Node.js / Bun / Deno)

const response = await fetch("https://api.cloudlayer.io/v2/url/pdf", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "<YOUR-API-KEY>",
  },
  body: JSON.stringify({
    url: "https://example.com",
    async: false,
  }),
});

const result = await response.json();
console.log(result.assetUrl);

Python

import requests

response = requests.post(
    "https://api.cloudlayer.io/v2/url/pdf",
    headers={
        "Content-Type": "application/json",
        "X-API-Key": "<YOUR-API-KEY>",
    },
    json={
        "url": "https://example.com",
        "async": False,
    },
)

result = response.json()
print(result["assetUrl"])

Tip: Even if your language does not have a dedicated SDK, the REST API is straightforward to use. See the Authentication Examples, HTML Examples, and URL Examples for more language-specific code samples.