HTML String to PDF - A4 Document Converter
codemaster devops · @codemasterdevops
Render HTML as a numbered A4 PDF in Chromium.

About
HTML String to PDF - A4 Document Converter
What does HTML String to PDF do?
HTML String to PDF renders supplied HTML in Chromium and saves a downloadable A4 PDF with numbered page footers. Use it to turn templated reports, invoices, and other documents into PDFs from a workflow or API.
What HTML can you convert?
- Submit one HTML string per run in the required
htmlStringfield. - Use inline CSS to style a self-contained document. Chromium applies print styles when rendering the PDF.
- Use HTML and CSS page breaks for longer documents. The footer shows the current page and total page count.
How to use HTML String to PDF
- Open the Actor's Input tab.
- Paste your document markup into HTML string and start the run.
- Open the run's key-value store and download the
OUTPUTrecord as a PDF.
{
"htmlString": "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><style>body { font-family: sans-serif; }</style></head><body><h1>Sample report</h1><p>Rendered from HTML.</p></body></html>"
}
Output and export
- Record key:
OUTPUT - File format: PDF. ByteWells serves the bytes as
application/octet-stream. - Example contents: an A4 page with the heading Sample report, the line Rendered from HTML., and the footer Page 1 of 1.
- For an API download, read
defaultKeyValueStoreIdfrom the completed run. Send an authenticated GET request tohttps://bytewells.com/api/v2/key-value-stores/{storeId}/records/OUTPUTand save the response bytes as a.pdffile.
Limits
- Each run accepts one HTML string. Send separate runs for separate documents.
- A URL alone is treated as text. To render a page, supply its HTML.
- Remote images, fonts, and styles depend on whether Chromium can reach their URLs. Inline styles and embedded assets make documents more portable.
- The Actor saves a binary PDF record. The run's dataset has zero rows.
FAQ
- What does the Actor convert?
- It converts one HTML string into an A4 PDF with page numbers.
- What input does it require?
- Set htmlString to the markup for the document. You can include inline CSS.
- Can I submit a webpage URL?
- Submit the page's HTML in htmlString. A URL by itself renders as text.
- Where do I download the PDF?
- Open the completed run's key-value store and download the OUTPUT record. Save the downloaded file with a .pdf extension.
- Can I download the PDF through the API?
- Yes. Use defaultKeyValueStoreId from the completed run to retrieve the OUTPUT record through the authenticated ByteWells key-value store API.
- Why is the dataset empty?
- The Actor saves its result as a binary PDF in the key-value store. The default dataset has zero rows.
- Can the PDF have multiple pages?
- Yes. Chromium paginates longer documents, and each page footer shows the current page and total page count.
- Will external images and fonts render?
- They can render when Chromium can reach their URLs. Embed assets and styles for a self-contained document.
- Can I convert several documents in one run?
- Each run renders one HTML string. Run the Actor separately for each document.
- What does the rental cost?
- The rental costs $19.99 per month after a 3-day free trial. ByteWells bills run compute separately.
Input
Preview of the input form. Rent the Actor to fill it in and start runs from the console.
Fields
htmlStringHTML markup for one PDF. Include inline CSS for a self-contained document.
API
Bytewells speaks the Apify API. Existing integrations keep working: point apify-client at https://bytewells.com/api and use your Bytewells API token (Console → Settings → API access). The Actor ID is codemasterdevops/html-string-to-pdf (or codemasterdevops~html-string-to-pdf in URLs).
JavaScript · apify-client
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.BYTEWELLS_TOKEN,
baseUrl: 'https://bytewells.com/api',
});
const input = {
"htmlString": "<!doctype html><html><body><h1>Sample report</h1><p>Rendered from HTML.</p></body></html>"
};
const run = await client.actor('codemasterdevops/html-string-to-pdf').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);Python · apify-client
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["BYTEWELLS_TOKEN"], api_url="https://bytewells.com/api")
run_input = {
"htmlString": "<!doctype html><html><body><h1>Sample report</h1><p>Rendered from HTML.</p></body></html>"
}
run = client.actor("codemasterdevops/html-string-to-pdf").call(run_input=run_input)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)HTTP · curl
curl -X POST "https://bytewells.com/api/v2/acts/codemasterdevops~html-string-to-pdf/runs" \
-H "Authorization: Bearer $BYTEWELLS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"htmlString":"<!doctype html><html><body><h1>Sample report</h1><p>Rendered from HTML.</p></body></html>"}'Runs are billed as compute from your credit balance. Paid Actors need an active rental or trial; otherwise the API answers 402 rental-required.
Related
More Actors from the same publisher.

Best Buy Products Scraper
codemaster devops · @codemasterdevops
Extract Best Buy product names, SKUs, available prices, images, and US reviews for catalog research and price tracking.
E-commerceAutomationDeveloper tools$19.99/mo3-day free trial
JSON-LD Tag Extractor for Schema.org Audits
codemaster devops · @codemasterdevops
Extract JSON-LD structured data from a list of URLs. Export parsed Schema.org markup for technical SEO audits and data pipelines.
SEO toolsDeveloper toolsAutomation$19.99/mo3-day free trial
Shopify Products Scraper
codemaster devops · @codemasterdevops
Export public Shopify prices, SKUs, stock status, options, and images in one row per variant. Compare catalogs across stores.
E-commerceAutomationDeveloper toolsUsage-based
Website Metadata Extractor
codemaster devops · @codemasterdevops
Extract page titles, meta descriptions, Open Graph tags, X Card tags, and canonical links from public URLs for SEO and social preview audits.
SEO toolsDeveloper toolsAutomation$19.99/mo3-day free trial
Website Screenshot Generator
codemaster devops · @codemasterdevops
Capture full-page or viewport PNG screenshots from a list of URLs. Export page URLs and image links for visual QA, monitoring, and archives.
Developer toolsAutomation$19.99/mo3-day free trial
Amazon Bestsellers Scraper
codemaster devops · @codemasterdevops
Extract Amazon Best Sellers ranks, product names, available prices, and links for category research and competitor monitoring.
E-commerceAutomation$19.99/mo3-day free trial