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

Overlapping text in jsPDF 2.0.0 is not caused by one universal setting. First confirm that the TTF is loaded into jsPDF’s virtual file system, registered with the exact family and style names you select, and rendered through the path you think you are using. Then determine whether the collision is vertical (line baselines are too close) or horizontal (glyphs or words overlap, or the next text starts at the wrong x-coordinate). Those symptoms point to different checks.

For documents produced with html() or the context2d API, also check the 2.0.0 release context: the project’s release notes list a fix for custom-font use on that route. That note does not prove that every font or rendering path is fixed. The reliable approach is a minimal reproduction, explicit font selection, one layout change at a time, and verification of glyph coverage.

Start with a minimal reproduction

Remove tables, images, automatic page breaks and unrelated CSS. Keep the same TTF file, a short string that shows the problem, and one rendering route. A minimal file tells you whether the failure is in font registration, text measurement, line placement or the HTML/context2d integration.

Use a string containing both ordinary Latin characters and any characters that fail in the real document. If the short sample is clean, add your layout pieces back one at a time. This is diagnostic isolation, not a claim that a particular sample has been tested here.

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

Register and select the TTF explicitly

The jsPDF project documents a TTF workflow that adds the font data to its virtual file system, registers the family and style with addFont, and selects it with setFont. The names passed to registration and selection must match. Start from the project’s README workflow: jsPDF custom-font instructions.

Direct text() example

import { jsPDF } from 'jspdf';
import fontFile from './fonts/Example-Regular.ttf?arraybuffer';

const pdf = new jsPDF({ unit: 'pt', format: 'letter' });

// Convert the imported ArrayBuffer to the binary string expected by jsPDF.
const bytes = new Uint8Array(fontFile);
let binary = '';
for (const byte of bytes) binary += String.fromCharCode(byte);

pdf.addFileToVFS('Example-Regular.ttf', binary);
pdf.addFont('Example-Regular.ttf', 'Example', 'normal');
pdf.setFont('Example', 'normal');
pdf.setFontSize(12);

pdf.text('A short string with troublesome characters: café — 123', 72, 72);
pdf.save('font-check.pdf');

Your bundler may expose the TTF as a base64 string, URL or ArrayBuffer rather than the import form above. The important sequence is unchanged: add the file, call addFont with the same internal filename, register the family/style, then call setFont before writing text. If you register Example but select Example-Regular, jsPDF may fall back to another face and produce different metrics.

Check the active font before writing

Put setFont('Example', 'normal') immediately before the first affected call, especially when code switches between bold, italic and regular text. Do not rely on a previous page or helper function having left the desired font selected.

Identify the rendering path

jsPDF can write text directly with text(), or generate a document through html() and context2d. Test the same string through the route used by your application.

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

Direct text output

With text(), you control x/y coordinates and any line spacing you calculate. A collision between lines is usually a coordinate or line-height problem; a collision inside one line requires checking font selection, width calculations and manually advanced x positions.

html() or context2d

The jsPDF 2.0.0 release notes, dated 2020-08-11, say: “Fixed usage of custom fonts in context2d/when using the html method.” See the 2.0.0 release summary for the exact release context. Treat this as a route-specific lead, not a guarantee for every browser, stylesheet or TTF. Generate a tiny HTML document with the same font and compare it with a direct text() call. If direct text works but HTML output does not, concentrate on the 2.0.0 HTML/context2d integration, computed CSS and the font asset actually reaching the browser.

Classify the collision before changing values

What you see Likely dimension to inspect First checks
Lines from successive rows touch or share pixels Vertical placement Baseline y-coordinates, line-height, font size and page scaling
Letters within one word overlap Glyph metrics or font substitution Active family/style, TTF loading, glyph coverage and width measurement
Words overlap or the next word starts too far left Horizontal advance Measured width, manual x increments, selected face and fallback behavior
Text is replaced by boxes, odd symbols or missing characters Glyph coverage Whether the TTF contains every required character and whether the intended font was selected

This distinction matters because increasing line-height cannot repair a wrong horizontal advance, and changing font size cannot add missing glyphs. The available issue report describes one overlapping-words case and recommends explicit font selection plus font-size and line-height adjustments; it is evidence for those checks in that report, not a universal diagnosis. Read issue #3655, “jsPDF: custom font styling problem” for that reported scenario.

Rank #2
Keto Diet Cheat Sheet Fridge Magnet Charts for Diet Foods - 12 Pcs Quick Reference Guide with 228 Foods - Including PDF Ketogenic Recipes Books for Beginners Weight Loss Plan
  • Perfect Beginner's Keto Accessory - This comprehensive set is perfect for anyone starting their keto journey, including 12 Keto refrigerator magnets sized at 3.8 x 4.3 inches, a PDF 500+ keto food list, a PDF keto recipe, and wallet-sized cards with 50+ fast food restaurant options. With all of these resources at your fingertips, sticking to your keto diet has never been easier.
  • Keto Guide for Easy Meal Planning - Meal planning can be a hassle, but with our cheat sheet refrigerator magnets, you'll have quick nutrition information for nearly all keto-friendly foods right at your fingertips. This makes it easy to prepare a grocery list or plan a keto-friendly meal without the need to constantly turn pages or hold your phone. Whether you're new to keto or a seasoned pro, our magnets will simplify your meal planning process.
  • High-Quality Keto Gift - Our refrigerator magnets feature a 25% larger font and are 20% thicker than other options on the market, ensuring they will stick to your refrigerator securely. With an oil-proof and waterproof design, they're also easy to clean and will last for years. This is the perfect gift for anyone following a keto diet or interested in starting one.
  • Comprehensive Keto Cheat Sheet Refrigerator Magnets - Tired of constantly googling the carb count of your favorite foods? Look no further than our 12-piece set of refrigerator magnets, featuring 228 keto-friendly items and an additional 488 food list. Our professional magnets are a must-have for any keto diet enthusiast, allowing you to easily track your carbs without constantly reaching for your phone or flipping through pages.
  • Compatibility and Excellent Customer Service - We want you to be completely satisfied with your purchase, which is why we offer a worry-free 18-month warranty and friendly customer service team available to assist you. If you have any questions before ordering, please leave us a message and we'll reply within 12 hours. Trust us to provide you with the best quality products and service.

Fix vertical baseline collisions

Use a predictable baseline increment

When writing lines yourself, calculate the next baseline from a single line-height value rather than repeatedly estimating positions.

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.
const fontSize = 12;
const lineHeight = 16; // points; choose deliberately for this document
let y = 72;

pdf.setFont('Example', 'normal');
pdf.setFontSize(fontSize);
for (const line of ['First line', 'Second line', 'Third line']) {
  pdf.text(line, 72, y);
  y += lineHeight;
}

Increase the increment only until descenders from one line no longer touch the next. If the collision disappears when you use a built-in font but returns with the TTF, verify that the custom face is really active and that your line-height calculation is not based on a different font’s metrics.

Check CSS when using HTML

For html(), inspect the browser’s computed font-family, font-size and line-height. A webfont that has not finished loading when capture begins can make the browser lay out with a fallback face, then produce unexpected dimensions. Ensure the font is available before invoking the conversion and test with a single paragraph before restoring complex CSS.

Fix horizontal overlap and incorrect word positions

Measure with the selected face

If you place words manually, measure each word after selecting the custom font and add the intended gap. Do not measure with a built-in font and draw with the TTF.

pdf.setFont('Example', 'normal');
pdf.setFontSize(12);
const gap = 4;
let x = 72;
for (const word of ['Custom', 'font', 'layout']) {
  pdf.text(word, x, 72);
  x += pdf.getTextWidth(word) + gap;
}

Current jsPDF API documentation covers font selection, text methods, line-height controls and width-related APIs. Use it as current documentation, not as proof that every API behaved identically in the 2.0.0 release: jsPDF API documentation.

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

Look for fallback or mixed styles

Bold and italic requests can silently use a different registered face or a fallback if only the regular TTF was added. Register each style you use, or deliberately request the style that exists. Compare a one-line regular sample with the affected style; a change in glyph widths points to registration or font metrics rather than line spacing.

Verify glyph coverage

Custom TTF files must contain the characters your document needs, particularly for non-Latin text. Missing coverage generally appears as missing glyphs, replacement symbols or corrupted characters, although it can be mistaken for a layout problem. Test representative Unicode characters in isolation and confirm that the actual TTF file—not a similarly named webfont variant—is being embedded. The project’s README discusses this requirement in its custom-font guidance: README.

If only certain scripts fail, obtain a TTF with the required coverage or use a separate registered face for those characters. Do not try to solve missing glyphs by endlessly changing font size.

Apply changes one at a time

  1. Confirm registration: verify the VFS filename, family and style strings.
  2. Select explicitly: call setFont and setFontSize immediately before the test.
  3. Keep one route: test direct text() separately from html()/context2d.
  4. Classify the symptom: vertical baseline, horizontal advance or missing glyph.
  5. Change one variable: adjust line-height for vertical collisions, or font/measurement/positioning for horizontal ones.
  6. Regenerate and inspect: compare the same string and coordinates after each change.

This order prevents a larger line-height from masking a font fallback, or a smaller font from hiding an incorrect width calculation.

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

Troubleshooting common failures

The custom font appears to be ignored

Cause: the TTF was not added to the VFS, the internal filename differs, or the selected family/style does not match registration.

Fix: log the exact strings used by addFileToVFS, addFont and setFont; reduce to one font and one line; then export a PDF before adding other styles.

Only HTML output overlaps

Cause: the HTML/context2d route, computed CSS or font-loading timing differs from direct text output.

Fix: reproduce with a minimal HTML element, wait until the font is available, inspect computed styles, and check the 2.0.0 release-note fix without assuming it covers your exact integration.

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.

Changing line-height does nothing

Cause: the collision is within a line or is caused by wrong horizontal measurements.

Rank #4
Domary E Reader eBook Reader Tablet Digital Book 6in Screen PDF Audio Video Portable Built in Speaker Front Light Memory Card Slot for Learning (8G)
  • [EYE FRIENDLY DISPLAY] Enjoy a comfortable reading experience on the 6 inch screen designed to reduce and visual fatigue during long sessions. The clear display shows more text on each page and supports adjustable font sizes so fiction comics documents and study materials stay easy to read.
  • [EASY CONTROL DESIGN] Large page control buttons make navigation smooth simple and comfortable whether you are reading at home or on the go. The responsive layout helps you turn pages browse files and manage your library with less effort while the memory card slot gives you convenient storage expansion.
  • [WIDE FORMAT SUPPORT] Open more of the content you love without wasting time on file conversion. This reader supports popular formats such as PDF TXT DOC FB2 EPUB RTF PRC and MOBI so you can access books notes reference files and other documents with greater freedom and flexibility.
  • [MORE THAN READING] This compact device adds practical functions that make every session more engaging. Highlight important passages add annotations search definitions and enjoy audiobook playback through the built in speaker turning everyday reading into a richer and more interactive experience.
  • [PORTABLE EVERYDAY LIBRARY] Carry thousands of titles in one lightweight reader instead of packing bulky books. Ideal for commuting travel extracurricular learning and relaxing at home this slim black device keeps your favorite reading materials close at hand whenever inspiration strikes.

Fix: test one word at a time, measure with the selected TTF, and inspect x-coordinate arithmetic.

Characters are missing or replaced

Cause: the TTF lacks the glyphs or a fallback face is being used.

Fix: test the failing Unicode range, use a font with coverage for those characters, and register/select that face explicitly.

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

Different pages have different spacing

Cause: helper code changes font, size, scale or coordinates between pages.

Fix: set the font and size at each page or section boundary and centralize the baseline calculation. Keep units consistent; mixing pixels, points and scaled canvas coordinates can create apparent font errors.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and version notes

Embedding a TTF increases the document’s resources and can make generation slower than a built-in font, especially when you create many documents in one browser session. Reuse the loaded font data, avoid repeatedly converting the same file, and keep a minimal font subset when licensing and language coverage allow. These are engineering considerations, not measurements of a particular jsPDF build.

jsPDF 2.0.0 was released on 2020-08-11. Current API documentation may describe later behavior or names, so record the exact jsPDF version in a reproducible bug report. If a newer supported release is available to your project, test it separately; the 2.0.0 release note alone does not establish that upgrading fixes every overlap.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
EBTOOLS 6 Inch E Reader, Large Touch Screen with 800x600 High Resolution, Adjustable Font Sizes, Text Highlighting, Paper Like Display, Supports PDF EPUB MOBI, Long Battery Life (4G)
  • [Large Touch Screen for Personalized Reading] The 6 inch high resolution touch screen offers a responsive and immersive reading experience. easily adjust font sizes and styles to suit your preferences ensuring comfort during long reading sessions. the crisp 800x600 display delivers text and images for an enjoyable experience.
  • [Long Battery Life for Uninterrupted Reading] Equipped with a powerful 2500mah battery this e reader ensures weeks of reading on a single charge. the low power consumption and efficient design mean you can focus on your books without worrying about frequent recharging. perfect for travelers and readers alike.
  • [Portable Design with Eye Friendly Display] Lightweight and compact this e reader is perfect for on the go use. the paper like display reduces eye strain making it ideal for prolonged reading sessions. store thousands of books in one device and enjoy a clutter free reading experience anytime anywhere.
  • [Versatile Format Support for Seamless Reading] This e reader supports a wide range of formats including pdf txt doc epub and more. whether you are reading novels textbooks or documents the transition between content types is smooth and effortless. enjoy a seamless reading experience without compatibility issues.
  • [Advanced Features for Enhanced Interaction] Take your reading to the next level with text highlighting annotations and dictionary lookups. the built in audio playback feature allows you to listen to your favorite books. these interactive features make learning and reading more engaging and productive.

Or skip the browser setup

If your goal is a clean image or PDF of a web page rather than a PDF generated by jsPDF, ScreenshotNeo provides a website screenshot API and MCP server. It accepts 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, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. AI agents can call its MCP tools take_screenshot, get_page_info and capture_pdf.

Use the API documentation beside the request examples: ScreenshotNeo API docs.

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 includes full-page capture, lazy-image loading, element capture, device and viewport controls, retina scale, PDF paper and margin settings, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API and an OpenAPI specification. Parameter names used by other screenshot APIs also work for easier migration.

The Free plan includes 1,000 screenshots per month with no card. Paid plans are Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000; yearly billing gives two months free, and every feature is on every plan. Create a free ScreenshotNeo account to start.

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

Frequently Asked Questions

Should I fix the overlap by lowering the font size first?

No. First determine whether the collision is vertical, horizontal or caused by missing glyphs. Font-size changes can hide a symptom while leaving registration or measurement errors unresolved.

Does the jsPDF 2.0.0 HTML fix apply to direct text()?

The release note specifically mentions custom fonts in context2d and the html method. It does not establish a fix for every direct text() case or every custom font.

Why does a built-in font work when my TTF does not?

A built-in font bypasses your TTF loading, registration, glyph coverage and metric calculations. Compare explicit family/style selection and measured widths before changing the document layout.

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.

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