Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Send the template ID, dynamic data, and documented width and height overrides to the provider’s render endpoint. “Any size” means any dimensions that endpoint accepts—not unlimited output. For example, Templated documents 100–5000 pixels for each dimension and a 0.1–2.0 scale range, while other services expose different units, bounds, and controls. Validate the design at the requested aspect ratio because changing it can move percentage-based layers and pin offsets.

What “any size” means in a template API

A template-rendering API combines a saved design with runtime data and returns an image, PDF, HTML, or another provider-supported representation. The general request has three parts: an endpoint and authentication method, a template identifier, and the content or layer values to insert. Width and height are optional overrides only when the selected endpoint documents them.

There is no universal render URL, JSON schema, dimension unit, response type, or output format. One service may accept a JSON data object; another may require explicit layer overrides. Treat the provider’s current reference as the contract and do not copy parameter names from a different service without checking them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dimensions have provider limits

Templated documents width and height from 100 through 5000 pixels. It also documents a scale value from 0.1 through 2.0. Those are that provider’s parameter bounds, not an industry-wide rule. A different API may use points, millimetres, CSS pixels, a preset-size list, or no runtime dimension override at all.

Aspect ratio can change the design

A width and height override can produce a different canvas ratio from the template’s native proportions. RenderStack documentation warns: “When you override the width or height at render time (or use the sizes array for multi-page PDFs), the canvas aspect ratio may differ from the template’s native proportions.” Percentage-based transforms, anchored elements, text wrapping, and pin offsets can therefore resolve differently at the new size.

Compare the documented behavior before choosing an API

The following matrix separates what is documented from what is not established. “Not stated” means you must confirm it in the provider’s current reference.

Provider Endpoint or request model Dimension controls Documented formats Response model Aspect-ratio note Quota note
Templid POST /templates/{templateId}/render; dynamic data or layer overrides depend on the template schema Not stated in the cited documentation Not stated in the cited documentation Rendered subject, HTML, and text as JSON; PDF rendering can return a binary PDF Confirm in the endpoint reference Not stated
Templated Provider-defined render request with template data Width and height: 100–5000 pixels; scale: 0.1–2.0 JPG, PNG, WebP, PDF, MP4, HTML Not stated Test changed ratios against the template Each page render counts toward the API quota
RenderStack Provider-defined render request; PDF can use a sizes array Runtime width and height overrides; PDF size arrays are documented PNG, JPEG, PDF Not stated Overriding dimensions may change the canvas ratio and layer positioning Not stated
Jasper Image-template rendering with dynamic layer and background updates Scale is documented; arbitrary width and height control is not established Not stated Not stated Confirm behavior for non-native ratios Not stated

Implementation workflow

1. Identify the template and render route

Record the template ID, the render URL, authentication format, and whether the operation is synchronous or asynchronous. Templid’s documented route is POST /templates/{templateId}/render; another provider may use a completely different path. Store the endpoint in configuration rather than hard-coding it throughout your application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Read the template’s data contract

List every variable, layer name, required field, default, and permitted type. A template might expect headline and price in a JSON data object, while another API expects an array of layer overrides. Keep this mapping in your application so a renamed layer fails validation before you spend a render quota.

3. Add width and height only when supported

Use the documented names and units. For Templated, a pixel request between 100 and 5000 for each dimension is within the stated range. If the API offers only scale, do not send width and height fields and assume they will be honored. If it offers presets or a PDF sizes array, use those mechanisms exactly as documented.

4. Select an output format

Choose a format that the endpoint supports and that matches the consumer. PNG is useful for lossless graphics, JPG for photographs, WebP for compact web delivery, and PDF for paginated documents, but availability differs by endpoint. Templated lists JPG, PNG, WebP, PDF, MP4, and HTML; RenderStack lists PNG, JPEG, and PDF.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

5. Parse the response according to its type

A successful response can be JSON containing rendered fields, a binary file, or a URL or object describing a generated asset. Templid documents rendered subject, HTML, and text in JSON and a binary PDF response for PDF rendering. Check the status code and content type before attempting to decode the body as JSON or write it as an image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Validate before publishing

Render representative data at every production size. Inspect text wrapping, clipped content, alignment, image crops, transparent backgrounds, and PDF page breaks. Keep a golden set of inputs and compare outputs after template edits or provider changes.

Provider-neutral request examples

Because providers use different hosts and authentication schemes, the examples below take the endpoint and API key from environment variables. Set those variables to the exact values in your provider’s documentation, then adapt field names to that provider’s schema. The request shape illustrates the usual data, dimensions, scale, and format concepts; it is not a universal API contract.

cURL

export RENDER_ENDPOINT='https://your-provider-render-endpoint.example/path'
export API_KEY='YOUR_API_KEY'
curl -X POST "$RENDER_ENDPOINT" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" --data '{"template_id":"invoice-v3","data":{"customer":"Ada Lovelace","total":"$128.00"},"width":1200,"height":628,"format":"png"}' -o render.png

If the service uses a path parameter, place the template ID in that path instead of the JSON body. For Templid, that means the documented POST /templates/{templateId}/render route. If authentication uses an access-key header or query parameter, replace the bearer header accordingly.

Python

import os
import requests

endpoint = os.environ["RENDER_ENDPOINT"]
api_key = os.environ["API_KEY"]
payload = {
    "template_id": "invoice-v3",
    "data": {"customer": "Ada Lovelace", "total": "$128.00"},
    "width": 1200,
    "height": 628,
    "format": "png",
}
response = requests.post(
    endpoint,
    json=payload,
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=90,
)
response.raise_for_status()
content_type = response.headers.get("content-type", "")
if "json" in content_type:
    result = response.json()
    print(result)
else:
    with open("render.png", "wb") as output:
        output.write(response.content)

Use the provider’s documented response field when it returns a URL or JSON object. Do not assume every successful response is an image body.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Node.js

const endpoint = process.env.RENDER_ENDPOINT;
const apiKey = process.env.API_KEY;
const payload = {
  template_id: 'invoice-v3',
  data: { customer: 'Ada Lovelace', total: '$128.00' },
  width: 1200,
  height: 628,
  format: 'png'
};
const response = await fetch(endpoint, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(payload)
});
if (!response.ok) throw new Error(`Render failed: ${response.status}`);
const type = response.headers.get('content-type') || '';
if (type.includes('json')) {
  console.log(await response.json());
} else {
  const buffer = Buffer.from(await response.arrayBuffer());
  require('fs').writeFileSync('render.png', buffer);
}

Designing for arbitrary dimensions

Use layout rules that survive ratio changes

  • Anchor logos and controls to explicit edges rather than relying only on percentage coordinates.
  • Give text boxes enough width for the longest supported translation or data value.
  • Define minimum and maximum font sizes when the provider supports responsive rules.
  • Use object-fit or the provider’s crop mode for photos so a narrow canvas does not distort them.
  • Keep critical content inside a safe margin that works for both portrait and landscape outputs.

Choose separate templates when the composition is fundamentally different

A social card, a mobile banner, and a printable page often need different hierarchy, not merely different numbers. If changing the ratio causes overlapping elements or unreadable text, create variants and select the template by requested size. That costs more template maintenance but is safer than forcing one layout to cover incompatible compositions.

Test a dimension matrix

For each template, test at least the native size, the smallest allowed size, the largest allowed size, and one portrait and one landscape ratio. Include long and short values, missing optional values, and images with different aspect ratios. Save the request and response metadata so a visual regression can be traced to data, template changes, or provider behavior.

Performance, reliability, and cost planning

Control render volume

Render only the sizes your product actually serves. A request for every possible pixel dimension can consume quota quickly, especially where each page render counts toward usage, as Templated documents. Prefer a small, explicit size catalog for predictable demand.

Separate preview and production paths

Use lower-cost or lower-resolution previews while an editor is working, then render the final dimensions after approval. Keep production requests deterministic: send the same template version, data normalization, fonts, and asset URLs that you validated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Handle transient failures safely

Set a client timeout appropriate to the provider’s documented behavior, record the HTTP status and request identifier, and retry only errors the provider identifies as transient. Use bounded exponential backoff and a maximum attempt count. Do not blindly retry validation errors, unknown template IDs, or out-of-range dimensions; those requests will fail again and may still consume processing or quota.

Cache deliberately

If the same template version, data, dimensions, and format always produce the same output, cache the result in your own system where permitted. Include every input that can affect pixels in the cache key, including locale, timezone, asset version, and scale. Invalidate the key when any of those inputs changes.

Troubleshooting common failures

400 or validation error

Cause: a required field is missing, a layer name is wrong, or width, height, scale, or format is outside the documented range. Fix: log the exact JSON sent, compare each field with the template schema, and verify units and bounds. For Templated, check that width and height are each 100–5000 pixels and scale is 0.1–2.0.

401 or 403 authentication error

Cause: an invalid key, wrong authentication header, expired credential, or restricted project. Fix: reproduce the request with the provider’s authentication example, confirm the key belongs to the project containing the template, and keep secrets out of client-side code and logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

404 template or endpoint error

Cause: the template ID is misspelled, the template is in another workspace, or the route differs from the one you used. Fix: copy the current render path exactly; with Templid, verify the /templates/{templateId}/render segment and the ID’s case.

Successful response but unreadable file

Cause: the response is JSON or a generated-asset descriptor, not binary image data. Fix: inspect the status and Content-Type, then parse JSON or download the returned asset URL as required.

Elements move or disappear at a new size

Cause: the aspect ratio changed, so percentage transforms, pin offsets, wrapping, or clipping resolved differently. Fix: inspect the layout at the failing ratio, replace fragile percentages with anchored constraints, adjust text boxes and crop rules, or route that ratio to a dedicated template.

PDF pages break unexpectedly

Cause: the selected paper size, margins, orientation, page range, or multi-page sizes differ from the template assumptions. Fix: define those PDF options explicitly, render every supported page size, and check page breaks with the longest content.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your template is already rendered as a web page and your remaining task is to capture that page, ScreenshotNeo is the first screenshot API to try: it removes consent banners, popups, and chat widgets before capture, bills only clean shots, and its paid plan starts at $5 for 3,000 shots.

This does not replace a template-rendering API; it captures the final URL at a viewport. It supports any viewport, full-page or element captures, dark mode, retina scale, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, timezone and geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs, bulk capture, and PDF output. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

Use the same one-call pattern from the ScreenshotNeo documentation:

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Replace the target URL with the page containing your rendered template. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and each response reports its result through X-Page-Verdict and X-Billed headers. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQ

Are width and height normally measured in CSS pixels?

Not necessarily. Templated documents pixel dimensions, but another provider may use a different unit or a preset system. Use the unit stated by the endpoint and do not infer it from the browser viewport.

Should one template serve every aspect ratio?

Only when its constraints remain readable and aligned across those ratios. When the hierarchy changes between portrait, landscape, and print, separate template variants are usually more maintainable than increasingly complex conditional positioning.

How should I budget quota for multi-page documents?

Count the provider’s billable unit exactly as documented. Templated states that each page render counts toward its API quota, so a five-page document can consume five page renders rather than one request unit.

Frequently Asked Questions

Are width and height normally measured in CSS pixels?

Not necessarily. Templated documents pixel dimensions, but another provider may use a different unit or a preset system. Use the unit stated by the endpoint and do not infer it from the browser viewport.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should one template serve every aspect ratio?

Only when its constraints remain readable and aligned across those ratios. When the hierarchy changes between portrait, landscape, and print, separate template variants are usually more maintainable than increasingly complex conditional positioning.

How should I budget quota for multi-page documents?

Count the provider’s billable unit exactly as documented. Templated states that each page render counts toward its API quota, so a five-page document can consume five page renders rather than one request unit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.