October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan 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 desk5 min

HTML to Image: Make Food Delivery Menu Cards for Indian Platforms

A practical Playwright workflow for turning an HTML food-delivery menu card into a clean image, with export options, platform-size caveats, and quality checks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To turn a menu card made in HTML into an image, render it in a real browser and capture just the card—not the surrounding page. Set the card to its intended dimensions, wait for fonts and food photos to load, export PNG, JPEG, or WebP, then inspect the result for legibility and cropping. This method preserves the layout your CSS actually creates and works for menu cards, dish lists, and promotional graphics.

Build the card at its intended size

Start with a fixed-size card frame and place the content inside it. Keep dish names and prices easy to scan, use strong text/background contrast, and leave breathing room around food images and important text. A browser screenshot captures the rendered layout; it does not automatically make a crowded or poorly sized design readable.

As an Amazon Associate I earn from qualifying purchases.

Use CSS pixels to define the layout, then choose the output scale deliberately. If the card is 650 by 700 CSS pixels and you capture at CSS scale, the resulting image is 650 by 700 pixels. A device-scale capture can produce more output pixels for the same CSS-sized card. Playwright documents both screenshot scales, element screenshots, clipping, full-page capture, and PNG, JPEG, and WebP output in its Page screenshot API.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Render and export the card with Playwright

Install Playwright and its Chromium browser in a Node.js project:

#1 Best Overall
Wedding Menu Cards 4"x9", 60 Sheets White Linen Textured Cardstock
  • PREMIUM LINEN TEXTURE MENU CARDS 80LB COVER 230GSM CARDSTOCK: Heavyweight 4"x9" cardstock features elegant linen textured finish, great hand feel, reduces ink show through for sharp handwriting and premium looking wedding menu cards
  • PRACTICAL 4" X 9" RACK CARD DIMENSION: Versatile menu cardstock offers ample design space, perfect for wedding menus, menu paper, wedding thank‑you notes,reserved seat cards,christmas cards,wedding programs, marketing mailers, announcements and event promotional projects
  • ELEGANT TEXTURED PRINTABLE SURFACE: Distinct linen texture adds upscale visual touch for restaurant menus, banquet events, branding and personalized crafts; delivers clean print output without unwanted glare
  • INKJET, LASER & COPIER COMPATIBLE: Optimized for home & commercial printers for smooth feeding; produces crisp texts and graphics. Confirm your printer supports 80lb cover weight before printing thick cardstock
  • WHAT YOU RECEIVE: 60 pieces blank linen‑textured cards 4×9 in printable cards; ready‑to‑use for menus, special occasions, business communications and assorted DIY printing needs
npm install playwright
npx playwright install chromium

Save the following as render-card.js. It opens a local HTML file, waits for fonts and images, captures the element with the menu-card ID, and writes a PNG. Change the file path, selector, and output name to match your project.

const { chromium } = require('playwright');
const path = require('path');

(async () => {
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage({
    viewport: { width: 900, height: 1000 },
    deviceScaleFactor: 1
  });

  await page.goto(`file://${path.resolve('menu.html')}`, {
    waitUntil: 'networkidle'
  });
  await page.evaluate(async () => {
    await document.fonts.ready;
    await Promise.all(
      Array.from(document.images, image => {
        if (image.complete) return Promise.resolve();
        return new Promise(resolve => {
          image.addEventListener('load', resolve, { once: true });
          image.addEventListener('error', resolve, { once: true });
        });
      })
    );
  });

  const card = page.locator('#menu-card');
  await card.screenshot({ path: 'menu-card.png', type: 'png' });
  await browser.close();
})();

Run it with node render-card.js. The browser viewport should be large enough to display the whole card without responsive breakpoints changing the intended layout. The element screenshot keeps the export focused on the card; use a clip instead if your design does not have a single wrapper element.

Choose the capture area

  • Element: capture the card container for a single menu asset. This avoids browser-page whitespace and unrelated content.
  • Clip: capture a deliberate rectangle when the card is not represented by one element. The clip coordinates are in CSS pixels.
  • Full page: use only when the whole page is the deliverable. It may include multiple cards, page backgrounds, or extra content, and can create a much taller image than intended.

Choose the image format

  • PNG: supports transparency and is suitable when you need crisp text or a transparent background. Playwright does not apply its JPEG quality setting to PNG.
  • JPEG: supports a configurable quality setting and is often smaller for photographic content, but cannot preserve transparency.
  • WebP: another supported output format; confirm that the destination accepts it before using it.

For example, change the element screenshot options to { path: 'menu-card.webp', type: 'webp', quality: 85 } for a WebP export. For a transparent PNG, use { path: 'menu-card.png', type: 'png', omitBackground: true }. Transparency depends on the card itself not painting an opaque background.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
100 Pack - 4" x 9" Menu Paper Rack Cards - 100lb Cover (270gsm) Matte Natural Cream Cardstock - Inkjet Laser Printer Compatible - Restaurant Menus Takeout Lists Drink Specials Event Programs
  • VERSATILE MENU & PROMOTIONAL USES – Perfect for restaurant menus, drink specials, takeout lists, promotional rack cards, event programs, spa service menus, and retail product lists. The tall 4" x 9" format fits standard menu holders and display racks.
  • PREMIUM MATTE NATURAL CREAM CARDSTOCK – Crafted from sturdy 100lb Cover (270gsm) cardstock with a smooth matte finish and warm natural cream tone that gives menus and promotional cards an elegant, professional presentation.
  • PRINTER COMPATIBILITY – Designed for smooth feeding and crisp results with most inkjet printers, laser printers, and digital copiers, making it easy to print professional menus and rack cards directly from your office or shop.
  • STANDARD 4" x 9" SIZE FORMAT – Classic rack card and menu size ideal for tabletop displays, brochure racks, takeout counters, reception desks, and retail displays. Perfect for tri-section menu layouts, specials lists, or service menus.
  • FREE TEMPLATES & ONLINE DESIGNER – Includes downloadable templates plus access to the Desktop Publishing Supplies online template designer so you can quickly customize, format, and print professional menus and rack cards.

Check dimensions and platform requirements

Do not assume one pixel size works for every Indian food-delivery asset. A dish photo, a menu page, a cover image, and a custom promotional card can have different upload rules and crop behavior. Check the current partner-app upload flow for the exact asset type, accepted formats, file-size limit, and whether the platform crops or resizes uploads.

Zomato’s surfaced guideline page gives a maximum of 650 × 700 pixels for menu pages and recommends 1200 × 600 pixels or greater for cover photos. The page does not state a publication year, and those figures refer to different asset types; they are not a verified, current universal specification for HTML-generated cards. See Zomato’s partner resources and confirm the applicable rule in the upload workflow before exporting to those dimensions.

Swiggy’s November 3, 2023 feature article describes capturing and uploading menu images through the Swiggy Owner app and says the feature validates and enhances images, but it does not establish pixel dimensions for HTML-generated menu cards. See Swiggy’s Photoshoot feature article. Do not treat its photo workflow as a specification for a generated card.

Rank #3
White Business Note Cards 4" x 9" 80lb Cover (218gsm) - 100 Cards
  • HEAVYWEIGHT 80LB COVER (218GSM) CARDSTOCK: Premium white cardstock provides a professional feel with excellent durability, crisp print quality, clean handwriting performance, and reduced show-through.
  • MENU CARD 4" X 9" SIZE: Rack card size provides ample space for menus, promotions, thank you messages, event information, marketing materials, announcements, and customer communications.
  • WHITE MATTE FINISH CARDSTOCK: Bright white printable surface delivers excellent contrast for logos, branding, graphics, menus, advertisements, business messaging, and personalized designs.
  • INKJET, LASER, & COPIER COMPATIBLE: Designed for dependable performance with inkjet printers, laser printers, and copiers delivering crisp text, vibrant graphics, and smooth feeding for home, office, restaurant, hospitality, and commercial printing use.
  • TRUSTED QUALITY, MADE IN THE USA: Manufactured by Desktop Publishing Supplies, a family-owned company with over 30 years of experience producing premium heavyweight cardstock and paper products.

Inspect the exported image before uploading

  • Open the exported file, not just the browser preview. Check that the final dimensions and format are what you intended.
  • View it at approximately the size a customer will see on a phone. Increase text size or simplify the layout if dish names and prices are hard to scan.
  • Check the card edges for clipped text, cut-off food imagery, or an unexpected margin. Vertical photos can lose focal details when cropped, a concern noted in Zomato’s older guidance.
  • Confirm that remote images and web fonts finished loading. A network-idle wait is helpful, but sites with continuing network activity may need an explicit selector or a short, controlled wait instead.
  • Upload a test asset through the platform’s current partner flow and review its final preview, since platform-side resizing or cropping may change the result.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common rendering problems

The output is blank or missing images

Check that the HTML path is correct and that image URLs can be reached by the browser process. For remote images, wait for them to load and inspect the browser console or network errors. If the page keeps making requests, networkidle may not be a reliable readiness signal; wait for a specific card selector or image state instead.

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

The font differs from the design

Make sure the font file or font service is available to the browser, and wait for document.fonts.ready before capture. If the render runs in a restricted environment, a remote font may fail to load; use an accessible local font file or a reliable system fallback.

The card is clipped or unexpectedly large

Capture the card element rather than the entire page, and verify that the wrapper has the dimensions you intended. Check whether responsive CSS changes at the selected viewport and whether margins, shadows, or overflow extend beyond the frame. Increase the viewport if content is being laid out differently at a narrow width.

Rank #4
Square Terminal - Credit Card Machine to Accept All Payments | Mobile POS
  • With Square Terminal, you can ring up sales, accept payments, and print receipts, all with one device. Use it at the counter or ring up customers anywhere in your store.
  • Accept all major credit and debit cards and pay one low rate with no hidden fees and no long-term contracts.
  • Process chip cards in just two seconds.
  • Get your money as soon as the next business day.
  • Use it cordlessly with the built-in battery, designed to last all day.

The file is too large or transparency is missing

Use JPEG with an intentional quality value for opaque photographic artwork, or WebP if the receiving platform accepts it. For transparency, choose PNG and set omitBackground: true; JPEG cannot retain a transparent background. A PNG quality option will not reduce its size because Playwright does not apply that setting to PNG.

Or skip the browser setup

ScreenshotNeo can render a URL directly to an image or PDF. The following cURL request returns the screenshot bytes; replace the URL with a publicly accessible page containing your card. See the ScreenshotNeo API documentation for request options.

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

Quick Recap

Bestseller No. 4
Square Terminal - Credit Card Machine to Accept All Payments | Mobile POS
Square Terminal - Credit Card Machine to Accept All Payments | Mobile POS
Process chip cards in just two seconds.; Get your money as soon as the next business day.; Use it cordlessly with the built-in battery, designed to last all day.
$298.99
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo and sign up free.

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. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.