Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober 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 Now×
Skip to content
HTML to PDF

How to Fix SVG Images Missing From iText 7 HTML-to-PDF Output

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

Start by recording the exact iText Core and pdfHTML versions, then reduce the document to a static SVG with explicit dimensions and no external dependencies. “iText 7” is not specific enough to identify SVG behavior: support expanded across pdfHTML releases, and fixes for data-URI SVG, percentage sizing, embedded SVG resources, and viewBox handling arrived at different times. Also determine whether your SVG is inline, a data URI, an external file, an <object>, or a CSS background, and whether it relies on JavaScript, stylesheets, images, or fonts.

This guide gives a reproducible diagnostic path for missing, blank, clipped, or differently styled SVG output, followed by a browser-free alternative using ScreenshotNeo when your actual requirement is to capture a rendered page rather than produce a standards-based PDF with iText.

Why an SVG can disappear in pdfHTML

pdfHTML parses HTML and CSS and maps them to iText layout and drawing objects. It does not execute JavaScript or behave like a full browser. An SVG generated after page load by a script therefore does not exist in the input that pdfHTML receives. Even static SVG can fail when its resources cannot be resolved, its geometry collapses to zero, or the deployed version does not support the SVG construct being used.

SVG support was introduced in pdfHTML 2.1.0 with iText Core 7.1.3 and has continued to expand. pdfHTML 3.0.3 (released January 14, 2021) added direct SVG input using the data:image/svg+xml notation and SVG <pattern> support. Those milestones describe particular releases, not a promise that every SVG feature works in every iText 7-era package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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

The current feature FAQ surfaced for this topic is based on pdfHTML 6.3.3 with iText Core 9.7.0. Do not treat that matrix as a compatibility table for an older iText 7 deployment; use release notes matching the versions actually installed.

Step 1: capture versions and the exact input form

Record the runtime and packages

Write down the Java or .NET runtime, the exact iText Core version, the exact pdfHTML version, and every other iText add-on involved. Confirm that the add-on and Core versions are a supported combination. “iText 7” alone cannot distinguish a missing feature from a dependency mismatch or a regression fixed later.

Classify how the SVG enters HTML

Input form What to verify first
Inline <svg> Explicit width, height, viewBox, and inline styles.
data:image/svg+xml Direct data-URI support requires pdfHTML 3.0.3 or newer.
<img src="file.svg"> Base URI, file permissions, MIME/path correctness, and nested resources.
<object> or another embedded form Whether that element type and its referenced resource are supported by your release.
CSS background Computed size, background-size, and viewBox interaction.

Test each form independently. A data URI that works does not prove that an external file, CSS background, or object will work in the same version.

Step 2: build a minimal, self-contained reproduction

Create a temporary HTML file containing one static SVG and no JavaScript, external stylesheet, web font, image, filter, or nested reference. Give the outer SVG explicit dimensions and a matching viewBox:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<!doctype html>
<html><body>
  <svg xmlns="http://www.w3.org/2000/svg"
       width="240" height="120" viewBox="0 0 240 120"
       role="img" aria-label="Test graphic">
    <rect width="240" height="120" fill="#1463ff"/>
    <circle cx="60" cy="60" r="35" fill="#fff"/>
    <text x="110" y="68" fill="#fff" font-size="22">SVG test</text>
  </svg>
</body></html>

Convert this file with the same code path and converter properties used by your application. If it appears, restore dependencies one at a time: first the stylesheet, then fonts, images, masks or patterns, and finally any nested SVG references. The first addition that makes the image vanish identifies the dependency class to investigate.

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⁴

This reduction is a diagnostic method, not a universal workaround. Keep the original input and the minimal case so a vendor or community report contains a reproducible difference.

Step 3: resolve every resource from a known base URI

Relative URLs in HTML and SVG are resolved against a base URI. Set that URI deliberately rather than relying on the process working directory, and verify that the converter can read every referenced file or URL.

  • Use an absolute, readable base directory for local assets.
  • Check the path and case of every href, xlink:href, CSS url(), image, font, and nested SVG reference.
  • Confirm that the conversion process has permission to read the files in production, not only on a developer workstation.
  • For remote resources, verify network access, redirects, authentication, TLS, and whether the resource is actually available to the server running iText.
  • Temporarily inline CSS, fonts, and small images to distinguish resolution failures from unsupported SVG features.

iText release history records a historical issue in iText 7.1.7 concerning transfer of a preset base URI from HTML to an inner SVG. A later pdfHTML 6.1.0 release record lists external CSS support for embedded SVG. These notes make version-specific resource behavior especially important: reproduce with your installed release and read the corresponding release notes.

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.

Step 4: check geometry before styling

Set non-zero dimensions

An SVG can be present but occupy no visible area. Start with numeric width and height on the outermost SVG. Then verify that its viewBox covers the artwork and uses the expected coordinate system. A percentage width or height can collapse when the containing block has no resolved size.

Remove CSS sizing temporarily

Test without percentage dimensions, background-size, transforms, and complex layout rules. pdfHTML 6.1.0 release notes list fixes for percentage width and height on top-level SVG in HTML and for SVG images using background-size together with viewBox. If the fixed-size test works, restore responsive sizing incrementally and give the containing element an explicit size.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • 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.

Check clipping and paint

  • Ensure paths are inside the viewBox; artwork outside it is clipped.
  • Check that fill and stroke are not transparent or the same color as the page.
  • Remove masks, clip paths, filters, and blend modes for the first reproduction, then add them back separately.
  • Check that a white SVG is not simply being drawn on a white PDF page.

Step 5: remove browser-only assumptions

pdfHTML does not evaluate JavaScript. If a framework inserts the SVG, fetches data, swaps a placeholder, or computes dimensions in the browser, supply the resulting static HTML/SVG to iText instead. Options include rendering the data before conversion in your application, exporting server-side markup, or using a browser engine when the page genuinely depends on client-side execution.

Do not use a browser screenshot as a silent substitute if you need selectable text, searchable PDF content, links, tagged structure, or predictable print pagination. Choose preprocessing only when JavaScript-generated content is a requirement that static pdfHTML input cannot satisfy.

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

Step 6: compare remediation choices

Choice Use it when Trade-offs
Keep the current version and simplify SVG The failing construct is optional and can be replaced with basic static markup. Least disruption, but may require design changes and still leaves unsupported features out.
Upgrade Core and pdfHTML Your release notes show the needed support or a relevant fix in a newer compatible release. Requires compatibility testing, dependency changes, and review of licensing terms.
Make resources self-contained The SVG depends on relative files, external CSS, fonts, or images. Improves reproducibility, but can increase HTML size and complicate asset updates.
Pre-render with a browser engine JavaScript or browser-specific layout is essential. Adds browser runtime, operational cost, and a different rendering pipeline; it is not equivalent to native pdfHTML output.

Do not upgrade solely because the phrase “iText 7” sounds old. First map the failing feature to the release notes for your Core/pdfHTML pair, then test the smallest upgrade that addresses it. Commercial use of iText Core and pdfHTML requires a commercial license; open-source downloads are available under AGPL terms, so involve your legal and procurement teams before deployment.

Reference conversion patterns

Use your normal iText converter and set a base URI appropriate to your application. The exact API differs between Java and .NET versions, so keep the package-specific sample from the documentation for your release. The important properties are static HTML, a resolvable base URI, and matching Core/pdfHTML dependencies.

For a data URI, keep the SVG URL-encoded correctly and test it separately from a file URL. For an external file, use a deterministic base directory and confirm the file exists from the converter process. Capture converter logs and the input HTML in a failing test so changes can be compared.

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

Troubleshooting by symptom

Nothing appears

  • Confirm the SVG is present in the HTML passed to iText, not only in a browser’s post-JavaScript DOM.
  • Replace it with the minimal fixed-size SVG.
  • Check base URI and every external resource.
  • Verify that the selected input form is supported by your pdfHTML version.

The SVG is blank but occupies space

  • Inspect fill, stroke, opacity, masks, filters, and clipping.
  • Check whether an external stylesheet failed to load.
  • Remove advanced paint servers and restore them individually.

The SVG is clipped or tiny

  • Compare the artwork bounds with viewBox.
  • Replace percentages with numeric width and height.
  • Remove background-size and test a normal <img> or inline SVG.

Images or fonts inside the SVG are missing

  • Resolve nested paths relative to the correct base URI.
  • Inline a small image or font for diagnosis.
  • Check file permissions, network access, authentication, and supported font formats.

It works after an upgrade but breaks elsewhere

  • Pin Core and pdfHTML versions together in the build.
  • Run the minimal SVG and representative production fixtures in CI.
  • Record the release-note item that justified the upgrade and test licensing and deployment constraints.

Or skip the browser setup

If your goal is a clean image or PDF of a web page rather than native iText document composition, ScreenshotNeo makes one HTTP request and returns PNG, JPEG, WebP, or PDF. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

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.

See the ScreenshotNeo API documentation for the complete option list, including full-page lazy-image loading, CSS-selector element capture, dark mode, device presets, retina scale, PDF paper and page-range controls, custom CSS/JavaScript, click and wait conditions, request blocking, headers, cookies, user-agent, authorization, timezone, geolocation, transparent backgrounds, resizing, selectable cache TTL, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage API, and OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

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

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try it.

What to include in a support report

Send the exact Core and pdfHTML versions, runtime and operating system, complete minimal HTML/SVG, converter properties, base URI, resource tree, exception and warning logs, and the PDF produced. State whether the SVG is inline, a data URI, external, an object, or a CSS background, and identify the first dependency that causes the minimal reproduction to fail. This information lets maintainers distinguish unsupported syntax, resource resolution, geometry, and a version-specific defect.

Frequently Asked Questions

Does switching from inline SVG to PNG always fix the problem?

No. It can avoid SVG feature support issues, but it changes scalability, accessibility, text behavior, and asset management. Use it only when those trade-offs fit the document.

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

Can I rely on the latest pdfHTML feature matrix for an iText 7.1.x application?

No. The currently surfaced matrix is for pdfHTML 6.3.3 with Core 9.7.0. Check release notes and compatibility for the versions you actually deploy.

Why does the SVG look correct in Chrome but not in the PDF?

Chrome executes JavaScript, resolves browser resources, and supports a broader rendering model. pdfHTML consumes static HTML/CSS and has its own version-dependent SVG support.

Quick Recap

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.

Read next

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.