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.

Yes. iText pdfHTML supports CSS Grid layout. Grid support was introduced in pdfHTML 5.0.5, released on July 24, 2024. The current iText feature FAQ is based on pdfHTML 6.3.3 with iText Core 9.7.0 and lists the principal Grid template, placement, row, column and area properties as supported.

That answer is about the documented feature set, not a promise of complete browser-equivalent CSS. A real template can still fail because of an unsupported value, another CSS module, or a renderer edge case. Check the exact combination you use in iText’s current feature matrix and HTML Converter demo.

What “CSS Grid support” means in pdfHTML

pdfHTML is iText’s HTML/XML-to-PDF add-on for Java and .NET. It parses HTML and CSS, then maps supported constructs to iText’s PDF layout model. For Grid, the converter also resolves higher-level concepts such as named grid lines and grid areas; it is not running a browser engine inside the conversion.

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

In practical terms, a layout using supported Grid properties can be converted to PDF without first replacing Grid with tables or flexbox. The conversion result is still governed by pdfHTML’s CSS implementation, PDF pagination rules and the behavior of the particular release you install.

Version history: which iText 7 answer applies?

Version context What is established How to use the information
pdfHTML 5.0.5 Released July 24, 2024; introduced CSS Grid Layout support. The announcement described most Grid features as fully supported at introduction. Use this as the historical point at which Grid became available, not as the current feature baseline.
iText Core 8.0.5 The Core release paired with pdfHTML 5.0.5. Do not assume behavior in this older pair is identical to later releases.
pdfHTML 6.3.3 The current feature FAQ’s documented baseline, paired with iText Core 9.7.0. Read the current matrix and test your template against the release you actually deploy.

The 5.0.5 announcement specifically said that display: inline-grid and subgrid values for grid-template-columns and grid-template-rows were not implemented at that time. The newer FAQ does not explicitly settle the present status of those value-level cases. Therefore, do not label them permanently unsupported or assume they work merely because the corresponding properties appear in a supported-property list.

Which CSS Grid properties are documented as supported?

The current feature FAQ marks the following properties as supported:

Grid area Properties
Automatic track sizing and placement grid-auto-columns, grid-auto-rows, grid-auto-flow
Explicit tracks and shorthand grid-template-columns, grid-template-rows, grid-template-areas, grid-template, grid
Item placement by columns grid-column-start, grid-column-end, grid-column
Item placement by rows grid-row-start, grid-row-end, grid-row
Named area placement grid-area

The same FAQ separates the order property from these Grid declarations: it marks order as supported for flex layouts but unsupported for Grid. A declaration being valid in one layout mode therefore does not make it valid in another.

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

A minimal Grid template to test

Before converting a production page, reduce the layout to a small document that exercises the declarations you depend on. This example uses explicit columns, named areas and item placement:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    .report {
      display: grid;
      grid-template-columns: 180px 1fr;
      grid-template-rows: auto 1fr auto;
      grid-template-areas:
        "header header"
        "nav main"
        "footer footer";
      gap: 12px;
    }
    header { grid-area: header; }
    nav    { grid-area: nav; }
    main   { grid-area: main; }
    footer { grid-area: footer; }
  </style>
</head>
<body>
  <div class="report">
    <header>Header</header>
    <nav>Navigation</nav>
    <main>Content</main>
    <footer>Footer</footer>
  </div>
</body>
</html>

This fixture is useful because a failure can be tied to a small set of Grid declarations instead of to an entire application stylesheet. Add your real fonts, images, page-break rules and other modules only after this baseline converts correctly.

How to verify a real template

  1. Identify the deployed pair. Record the pdfHTML and iText Core versions in the application, rather than relying on the product-family name “iText 7.”
  2. Inventory every relevant declaration. Include the property and the value: for example, an explicit track definition is a different test from a historical subgrid value.
  3. Check the current feature FAQ. Treat its matrix as a feature-by-feature reference. Support for the Grid properties above does not establish support for every CSS value or every neighboring CSS module.
  4. Run the complete HTML and CSS in the iText Demo Lab HTML Converter. iText says the converter uses the latest pdfHTML release, making it a practical first check when you are unsure about a feature.
  5. Compare the generated PDF at the target page sizes. Test the same margins, font files, images and content lengths used in production. A layout can look correct on one page and expose pagination problems when rows become taller.
  6. Promote the test to an automated fixture. Keep the HTML, CSS, expected page count and a visual reference under version control so an iText upgrade can be checked before release.

Where Grid support does not imply full CSS support

The FAQ is a support matrix, not a statement of complete browser parity. A Grid page commonly depends on other CSS features, and those features have their own status.

  • Custom properties: CSS cascading variables are documented as unsupported. Replacing a literal Grid value with a variable can therefore change the result even when the underlying Grid property is supported.
  • Transforms: transform is documented as partially supported, so transformed Grid children need a separate test.
  • Other layout declarations: The FAQ lists multiple unsupported layout-related properties. Do not infer their status from the Grid table.
  • Browser-only behavior: pdfHTML resolves CSS into PDF layout; it does not reproduce every browser algorithm, interaction or responsive breakpoint behavior.

For a template that combines Grid with flexbox, transforms, variables, web fonts, positioned elements or complex page-break rules, validate the combination rather than each feature in isolation.

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

Pagination and release-specific fixes

PDF pagination is a separate concern from placing items in a Grid. The pdfHTML 6.3.3 release information records fixes for slow conversion and duplicated list content in a nested Grid case, plus a renderer issue when Grid cells split across page breaks. Those notes show why the exact release matters: a layout that is structurally supported can still encounter a defect that is corrected later.

When a document fails only with long content, repeat the test with short and long cell values, explicit page sizes and the same break rules used in production. If the problem follows a page boundary, capture a minimal reproduction and check the release notes before changing the layout to a less expressive model.

Troubleshooting common failures

The whole page collapses into a single column

First confirm that the conversion uses a pdfHTML version with Grid support; versions before 5.0.5 predate the announced implementation. Then verify that the stylesheet is actually loaded and that display: grid is not being overridden. Reduce the page to the minimal fixture and run it through the current Demo Lab converter.

A declaration appears in the matrix but the output is still wrong

Check the value, not only the property name. The historical 5.0.5 limitation concerned specific values such as inline-grid and subgrid. The current FAQ does not explicitly resolve those cases, so test them directly instead of extrapolating from a supported property entry.

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.

Named areas do not line up

Validate the row strings in grid-template-areas: each row must describe the same number of cells, and every named area must form the shape your design expects. Then test the corresponding grid-area declarations in isolation. pdfHTML takes responsibility for resolving Grid areas, but malformed area definitions remain input errors.

The layout works until variables or transforms are added

Remove CSS custom properties and transforms from the reproduction. The FAQ documents cascading variables as unsupported and transforms as partially supported. Substitute literal values and test again; if the literal version works, the failure is in the additional CSS module rather than in basic Grid placement.

Cells render correctly until a page break

Use a long-content fixture that forces the same break, then test with the pdfHTML release you deploy. The 6.3.3 release information includes a fix for a renderer issue involving Grid cells split across page breaks, so an upgrade may be more appropriate than a markup rewrite. Confirm the result with your actual fonts and margins.

Conversion is unexpectedly slow or list content is duplicated

Try the smallest nested-Grid document that reproduces the behavior and compare your version with the 6.3.3 fixes for slow conversion and duplicated list content in nested Grid scenarios. Keep the reproduction when contacting iText support or evaluating an upgrade.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choosing Grid, flexbox or a fallback

Use Grid when the PDF needs two-dimensional tracks, named regions or explicit row-and-column placement and your tested declarations are supported. Flexbox may be simpler for one-dimensional rows or columns, but changing a Grid design solely to match browser habits can make complex page composition harder to maintain. A table-like fallback can be reasonable for a fixed report, yet it sacrifices the semantic and layout flexibility that motivated Grid.

The deciding criterion is not whether a browser accepts the CSS. It is whether the exact HTML, values, content lengths and page breaks produce the required PDF in the version you deploy. Keep a fallback only when testing shows that a required value or interaction with another CSS module remains outside pdfHTML’s documented support.

Or skip the browser setup

If your immediate goal is a clean image or PDF of the HTML result rather than server-side PDF conversion, ScreenshotNeo provides a website screenshot API. It accepts a URL, handles the page in a browser, and can capture PNG, JPEG, WebP or PDF output. Cookie and consent banners are accepted and more than 60 known consent platforms, newsletter popups and chat widgets are removed before capture; each step can be disabled.

Only clean shots are billed. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.

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

One request is enough:

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

See the full parameter list and response details in the ScreenshotNeo documentation. Every plan includes the available features, including full-page capture with lazy images loaded, CSS-selector element capture, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation controls, PDF page settings, caching, signed links, asynchronous webhooks and bulk capture for up to 100 URLs per call. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

Frequently Asked Questions

Does support for grid shorthand guarantee support for every Grid value?

No. The FAQ lists supported properties, while value-level behavior can differ. Test the exact declaration, especially historical cases such as inline-grid and subgrid.

Is pdfHTML 5.0.5 still the version to install for new work?

It is the release that introduced Grid, but the current documented baseline is pdfHTML 6.3.3 with iText Core 9.7.0. Evaluate the version your application will deploy and read its release notes.

Where can I check an unusual HTML/CSS combination without building a full application?

Use iText’s HTML Converter Demo Lab, which the FAQ identifies as using the latest pdfHTML release, then reproduce the result in an automated test with your production assets.

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

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.