apyhub
FILE CONVERSION · SMART GENERATION

Advanced Webpage to PDF API

What it does

PDF from URL turns a web page URL into a PDF file. Send an http or https page address and receive a binary PDF in return, ready to store, download, or attach to a workflow.

Use it when you need a printable snapshot of live web content: invoices rendered from a customer portal, archived copies of articles, internal documentation exports, or reports generated from dashboard pages. The request body accepts a required url plus layout options like landscape, page_size, margins, print_background, and optional header_html and footer_html for page numbering or custom branding.

The output is a PDF binary, so it fits cleanly into document pipelines and file-handling jobs. If your application needs to capture exactly what a browser renders without building your own print flow, this endpoint gives you a direct conversion path from URL to PDF.

POST
PDF from URL
http://localhost:8080/chisleroff/pdf-from-url
QUICKSTARTGUIDE

Quickstart

Convert a web page into a PDF by sending its URL.

curl -X POST "http://localhost:8080/chisleroff/pdf-from-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://apyhub.com"}'

What you'll get back

Returns a binary PDF file is the generated PDF content.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
URL of the web page to convert to PDF (http/https only).
Page orientation: true for landscape, false for portrait.
Page size: A4, Letter, Legal, A3, Tabloid.
Top margin with CSS units, e.g. 10mm.
Custom footer HTML, supports pageNumber/totalPages spans.
Custom header HTML, supports pageNumber/totalPages spans.
Left margin with CSS units.
Right margin with CSS units.
Bottom margin with CSS units.
Print background graphics.

About this endpoint

What it does

Converts a web page at a given URL into a PDF file. The request body lets you control page orientation, page size, margins, background printing, and optional custom header/footer HTML.

Request Body

ParameterTypeMandatoryDescription
urlStringYesURL of the web page to convert to PDF. Must be an http or https URI.
landscapeBooleanNoPage orientation. true for landscape, false for portrait. Default: false.
page_sizeStringNoPage size. Default: A4. Allowed values: A4, Letter, Legal, A3, Tabloid.
margin_topStringNoTop margin with CSS units. Default: 10mm.
footer_htmlStringNoCustom footer HTML. Supports pageNumber and totalPages spans.
header_htmlStringNoCustom header HTML. Supports pageNumber and totalPages spans.
margin_leftStringNoLeft margin with CSS units. Default: 10mm.
margin_rightStringNoRight margin with CSS units. Default: 10mm.
margin_bottomStringNoBottom margin with CSS units. Default: 10mm.
print_backgroundBooleanNoPrint background graphics. Default: true.

Response

Returns a binary PDF file is the generated PDF content.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.