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.

If a CSS float appears in the browser but disappears or moves in a PDF made by wkhtmltopdf, do not start by rewriting every float declaration. First identify the exact wkhtmltopdf executable and Qt build, then compare screen and print styles, reduce the document to a minimal float example, verify that CSS and images loaded, and determine whether the failure occurs only when content crosses a page boundary. There is no source-supported, universal CSS change that fixes every missing-float case.

Use this diagnostic order

  1. Record the binary path, version, package origin and Qt build used by the production process.
  2. Compare the media mode and print-specific CSS used for the PDF.
  3. Reproduce the layout with one floated element and the same dimensions.
  4. Check stylesheets, images, fonts and other resources in the conversion environment.
  5. Test the minimal case as a single page, then test it across a page boundary.
  6. Only after those checks decide whether wkhtmltopdf remains suitable for the document.

This order separates three different problems that look identical in a PDF viewer: a style rule was never applied, an asset or stylesheet failed to load, or the renderer laid out the float correctly and then split the long page during pagination.

1. Verify the executable and Qt build

Run the same command in the same container, service account or deployment image that creates the failing PDF. A local shell may be invoking a different binary from the one used by your application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
command -v wkhtmltopdf
wkhtmltopdf --version
which wkhtmltopdf

Save the complete output with the build artifact or incident report. Also record whether your application calls a wrapper, a container entry point or a remote conversion service. The project usage documentation describes conversion through a build with patched Qt, while the Debian manual warns that builds linked against unpatched Qt have reduced functionality. That warning does not prove that an unpatched build caused your missing float, but it makes build identity a necessary check.

#1 Best Overall
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.

What to compare

  • Absolute path to the executable.
  • The exact version string, including any distribution suffix.
  • Operating system and container image.
  • Command-line switches added by the application but not by your local test.
  • File permissions, network access and working directory of the service account.

Do not assume that two packages with the same apparent version have identical Qt patches. Re-run the failing input with the recorded binary before changing CSS; otherwise you may spend time fixing a layout that only fails in another build.

2. Compare screen and print CSS

wkhtmltopdf uses screen media by default according to its usage reference. The --print-media-type option switches the conversion to print media. That switch can expose an @media print rule that resets a float, changes its width, hides its parent, or alters display and overflow.

wkhtmltopdf input.html screen.pdf
wkhtmltopdf --print-media-type input.html print.pdf

Inspect the computed cascade in a browser and then inspect the rules that differ under print media. Search for declarations affecting the floated element and its containing block:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • display, float, clear and position
  • overflow, fixed heights and widths
  • negative margins and transforms
  • print-only selectors that hide or replace content
  • parent rules that collapse height or clip descendants

Make the browser comparison fair: use the same HTML, viewport assumptions, stylesheet files and media setting. If your application always passes --print-media-type, a browser preview using screen CSS is not an equivalent test.

Rank #2
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
  • Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.
  • Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
  • Read & Annotate. Enjoy intuitive reading modes and powerful tools to comment, highlight, and mark up PDFs.
  • Create & Manage PDFs. Create new PDFs, combine multiple files, scan documents, and compress for easy sharing.
  • Fill & Sign Forms. Complete forms and digitally sign documents with secure e-signature tools.

3. Build a minimal float reproduction

Create a tiny file that contains one floated block, adjacent text and the dimensions used by the real document. Keep the original stylesheet only if it is required to reproduce the behavior.

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    @page { size: A4; margin: 18mm; }
    .float { float: left; width: 35%; margin: 0 16px 8px 0; }
    .copy { line-height: 1.45; }
    .after { clear: both; }
  </style>
</head>
<body>
  <img class="float" src="image.jpg" alt="Example">
  <p class="copy">Text beside the floated image. Repeat enough text to test wrapping.</p>
  <p class="after">Content after the float.</p>
</body>
</html>

Render this file with the exact production command. Then add the original layout features one at a time: the framework stylesheet, nested containers, web fonts, generated content, tables, columns and JavaScript. The first addition that changes the PDF identifies the interaction to investigate.

Check resources, not only declarations

A float can appear to be missing when its image, stylesheet or font failed to load. Confirm that every URL is reachable from the conversion environment and that local files are permitted by your invocation. Use the converter’s documented load-handling options and user stylesheet option consistently between tests. A browser on your workstation may have cookies, DNS access, credentials and cached assets that the server process does not.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use absolute, deployment-valid URLs or a controlled local asset path.
  • Check the converter log and HTTP status for CSS and image requests.
  • Verify redirects, authentication headers and certificate trust.
  • Wait for assets that are inserted asynchronously before capture.
  • Test with a deliberately local, simple image to distinguish layout from network failure.

4. Decide whether this is a pagination failure

Render the minimal example so it fits on one page. If the float works there but disappears, overlaps or changes position when preceding content pushes it toward a page boundary, investigate pagination rather than the basic float declaration.

Rank #3
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
  • Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
  • Edit text and images without jumping to another app.
  • E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
  • Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
  • Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.

The archived Debian manual describes an old WebKit model in which content is laid out as one long page and then cut into pages. It warns that content can be split during that operation and notes that patched Qt’s page-break-inside support can mitigate some cases. The manual identifies its source as wkhtmltopdf 0.9.9-4 and dates the original manual to 23 February 2009, so treat this as version-context guidance, not proof of the mechanism in your current package.

Pagination experiments

  1. Remove most preceding content and confirm the float on page one.
  2. Add content in measured increments until the failure begins.
  3. Move the float earlier and later in the document.
  4. Temporarily remove nested blocks, tables and multi-column rules.
  5. Test conservative page-break rules on the float’s container and on the block that follows it.

Keep any workaround only if it passes the real document and the exact production build. A rule that helps one page length can create a blank region or a different break elsewhere.

5. Check the surrounding layout

Floats interact with their containing block. A parent with a fixed height, clipping overflow or an unexpected formatting context can make the floated child appear absent. A later clear can also force content farther down than expected, which is sometimes mistaken for a missing float.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Remove fixed heights from the float’s ancestors while testing.
  • Inspect overflow:hidden and clipping boundaries.
  • Give the parent a visible border temporarily to see its computed height.
  • Replace framework utility classes with explicit declarations in the minimal case.
  • Check that a print rule has not changed the float’s width to zero or set it to display:none.

Do not infer that floats are unsupported from one complex template. The available documentation does not establish that conclusion, and a changelog entry about a WebKit crash in RenderBlock::removeFloatingObjectsBelow does not show that your symptom is the same bug.

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
  • EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
  • READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
  • CREATE, COMBINE, SCAN and COMPRESS PDFs.
  • FILL forms & Digitally Sign PDFs. Work with Digital certificates

6. Make the conversion safer and repeatable

Pin the converter package and the container image, and retain the command line with each generated PDF. Add a fixture containing a float near a page boundary to your regression suite. Compare rendered PDFs after upgrades, because changing the Qt build can change CSS and pagination behavior even when the HTML is unchanged.

If your service accepts user-supplied HTML, treat it as untrusted input. The wkhtmltopdf project status page explicitly warns: “Do not use wkhtmltopdf with any untrusted HTML.” Sanitize HTML and URLs, restrict network access, isolate the conversion process and apply mandatory access controls appropriate to your deployment.

When to test another renderer

The wkhtmltopdf project status page describes its Qt/WebKit base as old: Qt 4 support ended in 2015 and QtWebKit was removed in 2016. It names WeasyPrint and the commercial Prince renderer as options report-generation users may consider, and points dynamic-JavaScript sites toward Puppeteer. These are candidates for testing, not guaranteed drop-in repairs.

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.
Decision axis Questions to answer with your documents
CSS compatibility Do the renderer’s supported layout features match your templates, including floats, flex or grid, generated content and fonts?
JavaScript Must scripts execute before layout, and can the renderer provide the required browser behavior?
Pagination How do page breaks, repeating headers, tables and long floats behave on representative inputs?
Deployment Can it run in your operating system, container and security boundary with your asset and font dependencies?
Maintenance Is the engine actively maintained for your security and browser-compatibility requirements?
Cost and license What licensing, support and infrastructure costs apply at your volume?

Run the same fixture set through each candidate and inspect both visual fidelity and operational behavior. The cited sources provide no comparative benchmark, so choose from observed results rather than a universal ranking.

Best Value
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
  • ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
  • MAXIMUM FUNCIONALITY – create interactive forms, compare PDFs, bates numbering, find and replace text or colors, convert documents, OCR engine, comment, highlight, fill out and print forms, document protection and others
  • EASY TO INSTALL AND USE – well-structured user-interface, in-program instructions, free tech support whenever you need it
  • GREAT VALUE FOR MONEY - why spend a fortune if you can have maximum functionality at a reasonable price - this also fits the requirements of companies very well
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

When the actual requirement is a clean screenshot or PDF of a URL rather than debugging a legacy float layout, ScreenshotNeo provides a single HTTP request and an MCP server for AI agents. Before capture it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status.

For a screenshot, see the ScreenshotNeo API documentation. The following calls use the supplied endpoint and parameters.

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}`);

ScreenshotNeo also supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets and custom viewports, retina scale, PDF paper and margin controls, custom CSS and JavaScript, pre-capture clicks, selector hiding, waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration.

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

An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account to try it without a card.

Troubleshooting checklist

The float is missing in every PDF

  • Confirm the production binary and Qt build.
  • Compare screen and print media output.
  • Inspect computed styles for display:none, zero width, changed overflow or a reset float.
  • Verify the stylesheet and image requests completed.

It works on one page but fails after a break

  • Reproduce with the smallest document that crosses the boundary.
  • Remove nested blocks and tables, then add them back individually.
  • Test page-break rules cautiously and retain only verified changes.

The local command works but production fails

  • Compare paths, versions, environment variables and command-line flags.
  • Check service-account permissions, DNS, certificates and authentication.
  • Confirm that production waits for asynchronous assets.

A renderer change fixes one template but breaks another

Keep both fixtures. Compare CSS support, JavaScript timing, pagination and deployment constraints before migrating; no alternative named by the project is guaranteed to preserve your existing output.

Frequently Asked Questions

Does adding clear: both fix missing floats?

It can control where following content starts, but it does not establish why a float disappeared. Test it only in the minimal reproduction and the full production document.

Should I always pass --print-media-type?

No. The documented default is screen media. Use the option only when your intended PDF design is defined by print CSS, and then audit the print cascade.

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

Is a newer wkhtmltopdf package guaranteed to solve the problem?

No. Build identity matters, but the available evidence does not establish a universal version-based fix. Compare exact builds and regression fixtures.

Quick Recap

Bestseller No. 1
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$99.99
Bestseller No. 2
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.; Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
$99.99
Bestseller No. 3
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$239.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
$29.99

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.