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
CSS

How to Align a Logo at the Bottom of the First Page in wkhtmltopdf Without a Footer

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

Put the logo in the page’s HTML and absolutely position it inside a wrapper for the first page. Give that wrapper a defined height, reserve enough room for the tallest supported logo, and make its dimensions agree with the PDF’s paper size and margins. This keeps the logo off later pages without relying on wkhtmltopdf’s repeating footer options.

Why page HTML is the right place for a first-page-only logo

wkhtmltopdf’s --footer-html and related --footer-* options are for document headers and footers, which normally repeat across pages. That is useful for page numbers or a recurring company mark, but not for a logo that belongs only at the bottom of page one.

Instead, make the first page a positioned container and place the logo relative to it. An absolutely positioned logo is anchored to its nearest positioned ancestor, so it can sit at the bottom of that page wrapper rather than at the end of the flowing text. Keep the logo inside the wrapper; do not place it in a global footer or rely on a fixed-position element.

Build a first-page wrapper with matching page geometry

The key is that the wrapper represents the printable area inside the page margins. For A4, the paper is 297 mm tall. With 12 mm top and 16 mm bottom margins, the printable height is 269 mm. For US Letter, the paper is 279.4 mm tall, so the same margins leave a printable height of 251.4 mm. Keeping the wrapper within that area avoids making the first-page content overflow onto another page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

A4 example

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
  @page { size: A4; margin: 12mm 12mm 16mm; }
  html, body { margin: 0; padding: 0; }
  .first-page {
    position: relative;
    box-sizing: border-box;
    height: 269mm;
    padding: 0 0 30mm;
  }
  .logo {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 100%;
    max-height: 24mm;
    width: auto;
    height: auto;
    object-fit: contain;
  }
</style>
</head>
<body>
  <section class="first-page">
    <!-- first-page content -->
    <img class="logo" src="logo.png" alt="Logo">
  </section>
</body>
</html>

The 30 mm bottom padding reserves a block for the logo and a little clearance. The logo itself can use up to 24 mm of height while retaining its intrinsic proportions. Adjust both values for your design, and set the reserved padding to at least the largest rendered logo height plus the clearance you want.

US Letter version

Change the page declaration to @page { size: Letter; margin: 12mm 12mm 16mm; } and the wrapper height to 251.4mm. Do not change only the paper size while leaving a first-page wrapper sized for A4: the bottom coordinate will no longer represent the same location on the sheet.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

The CSS page declaration and the command-line paper size and margins need to agree. The wkhtmltopdf manual documents paper controls including --page-size, --page-height, --page-width, and the -T, -R, -B, and -L margin options. In production, make the command-line settings authoritative and check the resulting PDF; wkhtmltopdf’s layout engine may not behave exactly like a current browser preview.

Render the PDF with explicit paper and margin settings

For the A4 CSS above, use matching command-line settings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
wkhtmltopdf 
  --page-size A4 
  --margin-top 12mm 
  --margin-right 12mm 
  --margin-bottom 16mm 
  --margin-left 12mm 
  input.html output.pdf

For Letter, replace --page-size A4 with --page-size Letter. You can instead specify a 279.4 mm page height with --page-height 279.4mm, but avoid mixing an explicit page height with conflicting paper settings. Whichever route you use, keep the CSS wrapper height calculated from the paper height minus the top and bottom margins.

The project manual describes wkhtmltopdf as converting one or more HTML pages to PDF using patched Qt. Confirm the exact build installed in your production environment; the cited manual covers version 0.12.6 with patched Qt, while older issue reports describe different behavior. A CSS layout that works in a desktop browser is not proof that it will render the same way in your installed wkhtmltopdf build.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Handle logos with different aspect ratios

Uploaded logos can be wide, tall, or nearly square. Set a maximum width and height, and let the image keep its intrinsic aspect ratio. The example’s max-width, max-height, and automatic dimensions are intended to prevent a tall logo from growing beyond its block or a wide one from exceeding the content width. object-fit: contain expresses the same fit-without-cropping intention, but test its behavior with your wkhtmltopdf build.

Plan the reserved bottom area around the largest logo you allow, not an average upload. Otherwise the image may cover text that flows to the bottom of the page. If you want the logo to span the available content width, use a bottom block with width: 100% and an image with width: 100%; height: auto; reserve enough padding for the maximum resulting height. This layout can make a short, wide logo taller than expected if its width is unconstrained, so set a maximum height or cap the container width when necessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the logo on the first page in a multi-page document

An absolutely positioned element belongs to its containing block; it is not a general instruction to place that element at the bottom of every page created by flowing content. For a document with later pages, use a distinct first-page wrapper, then start the rest of the content after it. If your document structure needs a forced transition, insert a deliberate page break after the wrapper and verify that it does not create an extra blank page.

A reported wkhtmltopdf issue for version 0.12.4 found that position: fixed; bottom: 0 appeared only on the last page and at the end of the text rather than at the page bottom. That report is specific to its version and setup, but it is a practical reason not to use fixed positioning as a substitute for a first-page container. Flexbox is also not a safe fallback without testing: a wkhtmltoimage issue report described no visible difference in its affected setup after adding flex alignment rules.

Common failures and how to fix them

  • The logo appears on every page. It is probably in a footer or positioned in a way that repeats with the page layout. Put it inside the first-page wrapper in the HTML and check that the wrapper itself ends before the following page content.
  • The logo sits after the text instead of at the bottom. Its containing block may not have a defined height or position: relative. Give the wrapper a height that matches the printable page area and use position: relative on it.
  • The logo is too low, too high, or clipped. Check the actual PDF’s paper size, margins, wrapper height, and bottom offset together. A mismatch between CSS geometry and wkhtmltopdf options changes where the wrapper’s bottom falls relative to the sheet.
  • Text runs behind the logo. Increase the wrapper’s bottom padding to cover the maximum rendered logo height plus clearance. A bottom-positioned image does not automatically reserve space in the normal text flow.
  • The second page starts unexpectedly or a blank page appears. The wrapper may exceed the printable height, its padding may have been added outside the declared height, or a page break may be duplicating a natural page transition. With box-sizing: border-box, padding is included in the declared wrapper height; check the full document in the generated PDF.
  • The alignment works in Chrome but not in the PDF. Render with the same wkhtmltopdf build used in production and treat that PDF as the result to validate. Avoid assuming fixed positioning or flexbox behaves as it does in a current browser.
  • The logo is missing. Check that the image path resolves from the HTML file’s location and is accessible to the process rendering the PDF. Test with a known-good image path before adjusting positioning.

Test the layout before shipping it

  1. Render with the exact wkhtmltopdf executable and build used in production.
  2. Generate separate A4 and Letter PDFs using the intended margins in both the CSS and the command line.
  3. Test at least a short-wide logo, a tall logo, and a square logo. Confirm none exceeds the reserved block or obscures text.
  4. Render a one-page input and a multi-page input. Check that only page one has the logo and that later content begins where intended.
  5. Inspect the PDF itself, including page boundaries and image placement. Do not rely only on an HTML browser preview.

Or skip the browser setup

If your goal is to capture a hosted webpage as an image or PDF rather than precisely position a custom logo in a wkhtmltopdf-generated document, ScreenshotNeo offers a screenshot API and MCP server. It is not a drop-in replacement for the first-page wrapper above when you need that exact PDF layout. For a webpage capture, the API call is:

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 API details. It accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. An MCP server gives AI agents tools for screenshots, page information, and PDF capture. 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 to get 1,000 screenshots a month with no card.

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

Frequently Asked Questions

Which wkhtmltopdf build should I validate against?

Use the same executable and build that will render the production PDFs; matching the tested build matters more than relying on a browser preview.

Can this place a logo at the bottom of every page?

This first-page wrapper method is intended for page one only. Repeating page furniture is a separate layout requirement and should be tested with a mechanism designed for recurring headers or footers.

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 *

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.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.