October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

HTMLCSStoImage HTML-to-PDF Conversion: Setup and Page Size Options

Set HTML/CSS to Image PDF dimensions and margins, choose Letter or A4, control backgrounds and scale, and prepare print-specific CSS.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To generate a PDF with HTML/CSS to Image, send a creation request to https://hcti.io/v1/image with a pdf_options object. Set the page width and height with units, then configure margins, scale, and background printing as needed. You can return a PDF URL directly with format: "pdf", or append .pdf to the image URL returned by the API.

Set up an HTML-to-PDF request

HTML/CSS to Image accepts HTML and CSS along with PDF options in a POST request to https://hcti.io/v1/image. Its service page describes Chromium rendering the content and returning a PDF URL. Keep API credentials in server-side code; do not expose them in browser-visible client code. For the full request and authentication details, see the Using the API documentation.

For a Letter-size PDF with half-inch margins and CSS backgrounds enabled, the PDF options take this form:

{
  "pdf_options": {
    "page_width": "8.5in",
    "page_height": "11in",
    "margins": ["0.5in", "0.5in", "0.5in", "0.5in"],
    "print_background": true
  }
}

Supply the HTML and CSS and include this object in the API request body using the documented request format. The parameter names, types, and defaults are covered in the PDF options reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

Choose a PDF output flow

Return a PDF URL directly

Set format: "pdf" in the creation request. The returned URL ends in .pdf. The documentation says the PDF is rendered when that URL is requested, rather than at the moment the creation response is returned. See the format parameter documentation.

Convert an existing image URL

Create an image through the normal flow, then request its returned URL with .pdf appended. The PDF options are applied when the PDF URL is requested. This method is useful when your existing integration already creates image URLs and you want a PDF output path as well. The PDF options documentation describes this flow.

Set dimensions, orientation, and margins

Use explicit width and height strings with units. The API documentation supports px, in, cm, mm, and pt. For print sizing, the vendor recommends inches or millimeters.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴
Paper size Width × height When it fits
Letter 8.5 × 11 in US standard documents
A4 210 × 297 mm International standard documents
Legal 8.5 × 14 in Documents needing extra page length
A5 148 × 210 mm Smaller-format documents

For landscape, swap the width and height values. For example, landscape Letter uses page_width: "11in" and page_height: "8.5in". Choose the recipient’s expected paper standard and the orientation that suits the content.

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

The margins array is ordered top, right, bottom, left. Set each side independently; for example, the documented A4 example uses 20 mm at the top and bottom and 15 mm on the right and left. The vendor recommends margins of roughly 0.5–1 inch for printable documents, but the right value depends on the content and output use.

Understand each PDF option

Option Behavior How to use it
page_width String dimension using a unit such as px, in, cm, mm, or pt Set alongside page_height for the desired paper size.
page_height String dimension using a supported unit Swap width and height for landscape orientation.
margins Four values in top, right, bottom, left order Specify each side separately with dimension strings.
scale Number from 0.1 to 2; default is 1 Adjust when content needs to fit or scale within the selected page.
print_background Boolean; default is false Set to true if the PDF should include CSS backgrounds, gradients, or colors.

Prepare HTML and CSS for printing

Web layouts often include navigation, controls, and screen-specific spacing that do not belong in a PDF. Use print media styles to adapt the page. HTML/CSS to Image’s documentation shows hiding elements marked .no-print and setting body text to 12 pt within @media print:

Rank #3
HP Smart Tank 5000 Ink Tank Printer | 2 Years of Ink Included | All-in-One
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
@media print {
  .no-print {
    display: none;
  }

  body {
    font-size: 12pt;
  }
}

Set print_background: true when backgrounds, gradients, or colors are part of the intended design; they are omitted by default. The vendor also recommends checking the selected page size before generating PDFs in bulk.

Fix content that does not fit

If a wide element extends beyond the page, first check whether its dimensions or layout can be adjusted in your CSS. If it must remain wide, the documentation gives a scale value of 0.75 as an example with explicit Letter dimensions. Scale is a layout control, not a substitute for checking the generated document: confirm that text and other content remain readable at the chosen page size.

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 task is taking a screenshot of a live website rather than rendering your own HTML/CSS with HTML/CSS to Image, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a screenshot or PDF. For example, this cURL request captures a page as WebP:

Rank #4
Sale
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for request options. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with the result identified in response headers. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Frequently Asked Questions

Can HTML/CSS to Image use page sizes other than Letter and A4?

Yes. Its PDF options accept width and height strings in px, in, cm, mm, or pt, so you can specify other dimensions.

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

Can I create a PDF from a public webpage with HTML/CSS to Image?

The service page describes sending HTML and CSS for rendering. The available documentation in this guide does not establish a specific public-URL-to-PDF request format, so consult its current API documentation for that workflow.

Quick Recap

Bestseller No. 3
HP Smart Tank 5000 Ink Tank Printer | 2 Years of Ink Included | All-in-One
HP Smart Tank 5000 Ink Tank Printer | 2 Years of Ink Included | All-in-One
PREMIUM SUPPORT - Strong technical expertise to solve issues faster; THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
$197.95

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.