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

html2pdf.js can make a page unresponsive because its promise-based workflow still performs DOM capture, layout, canvas rasterization, image encoding, and PDF assembly in the browser. Promises do not move that CPU-heavy work off the main thread. Start by exporting a smaller element and lowering the capture cost; for long reports, divide the work into sections and yield between them. A Web Worker is not a drop-in fix because it cannot access the live DOM.

Why html2pdf.js freezes the interface

html2pdf.js combines html2canvas to render HTML into a canvas and jsPDF to produce the PDF. The documented workflow runs in the browser. Capturing a large or complex element can trigger substantial style calculation, layout, image decoding, rasterization, encoding, and PDF work. While the main thread is busy, it has less opportunity to process clicks, paint updates, and respond to keyboard input.

Using await, a promise chain, or an async function helps sequence the operations, but it does not by itself shift synchronous work to another thread. Adding .then() to a single large capture likewise does not make the browser responsive during that capture.

Find which part of the export is expensive

  1. Open the browser’s Performance panel and record a profile while triggering a normal export.
  2. Repeat the capture with a reduced document, such as one report section without charts or large images.
  3. Compare scripting, layout, rasterization, image decoding, and signs of memory pressure. The comparison helps distinguish an oversized DOM from image work, page-break processing, or PDF encoding.

There is no universal html2pdf-specific time threshold that identifies a freeze. Compare your own normal and reduced exports in the browsers and devices you support; avoid treating one timing from one machine as a general benchmark.

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

Reduce the capture surface first

Pass the smallest stable element containing the content users need to export. Capturing an application shell may include navigation, controls, charts, off-screen content, and duplicate responsive layouts that do not belong in the PDF. Exclude those from the export representation or render optional sections only when requested. Less content generally means less cloning, style calculation, layout, and canvas work.

Use a deliberate export container rather than selecting the whole document. For example:

const report = document.querySelector('#report');
if (!report) throw new Error('Export element #report was not found');
await html2pdf().from(report).save();

Make sure the container is stable and has its intended export styles before calling the converter. A hidden or incomplete element can produce missing content rather than a faster, correct export.

Tune rasterization, images, and output quality

html2pdf.js passes settings to html2canvas. A lower scale can reduce the number of pixels the browser renders, trading sharpness for lower processing and memory demands. Image type and quality also affect encoding and file size: JPEG can suit photographic pages when lossy compression is acceptable, while PNG preserves lossless edges and transparency. Resize oversized source images where possible instead of asking the browser to rasterize pixels the PDF does not need.

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.

This is a starting configuration, not a universal optimum. Check text sharpness, image quality, page breaks, memory use, and load behavior in your target browsers:

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
const opt = {
  filename: 'report.pdf',
  image: { type: 'jpeg', quality: 0.85 },
  html2canvas: {
    scale: 1,
    useCORS: true,
    logging: false,
    removeContainer: true
  },
  jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
  pagebreak: { mode: ['css', 'legacy'] }
};

const report = document.querySelector('#report');
if (!report) throw new Error('Export element #report was not found');
await html2pdf().set(opt).from(report).save();

Options such as useCORS do not guarantee that every remote asset will load or be usable. Cross-origin images, fonts, and other resources can fail, delay capture, or affect the canvas. Test with the same origin and CDN configuration used in production, and configure or host resources deliberately. See the html2pdf.js documentation for supported options and details.

Make page breaks targeted

html2pdf.js supports CSS page-break rules, legacy break markers, and explicit before, after, and avoid selectors. For a long, deeply nested document, applying avoid-all broadly can make layout decisions more expensive. Prefer CSS break rules and explicit boundaries for known sections, tables, or headings, then inspect the resulting pages for overflow and awkward splits.

Split long exports and yield between sections

A single monolithic capture still occupies the main thread while that capture runs. If a report has natural sections, render them separately, add the output to the PDF using an integration suited to your chosen jsPDF workflow, and yield to the browser between sections. Update an application-level progress indicator after each completed section so users know the export is still working.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const yieldToBrowser = () => new Promise(resolve => setTimeout(resolve, 0));

for (let i = 0; i < sections.length; i++) {
  await renderSectionIntoPdf(sections[i]);
  progress.value = (i + 1) / sections.length;
  await yieldToBrowser();
}

renderSectionIntoPdf represents your own section capture and PDF assembly function; the precise assembly depends on how your application combines html2canvas output and jsPDF pages. The important point is to create a real task boundary between units of work. Yielding lets the browser handle queued work between sections, but it cannot make an individual oversized section cheap.

Progress should be presented as an estimate based on completed sections, not as a precise measure of remaining time. html2pdf.js documentation describes its own progress tracking as a work in progress, so application-level progress is the more controllable option.

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.

When to use requestAnimationFrame or requestIdleCallback

A timer yield such as setTimeout(..., 0) is a straightforward way to return control between sections. A requestAnimationFrame boundary can be useful when the page should paint an update before continuing. requestIdleCallback is intended for optional, low-priority preparation, not required export work that must run promptly; MDN marks it as limited availability and recommends providing a timeout for required work. Check support and provide a timer or animation-frame fallback as appropriate. See MDN’s Background Tasks API guidance.

Can html2pdf.js run in a Web Worker?

Not simply by moving the existing call into a worker. Web Workers can run laborious computation away from the main thread, but they cannot directly manipulate the DOM. A live HTMLElement therefore cannot be handed to a worker for the unchanged DOM-dependent capture path.

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

OffscreenCanvas can allow canvas rendering in a worker where supported, but browser support varies by feature and a library must be compatible with that rendering path. A worker solution needs an explicit plan for the content representation, rendering, PDF assembly, and messaging; it is not a switch in html2pdf.js options.

A realistic worker design

  1. Build a bounded, clean export representation on the main thread.
  2. Send serializable HTML or data, or prepared images, to the worker. Do not attempt to send a live DOM node.
  3. Perform only worker-compatible rendering or PDF work there, after verifying the renderer and target browsers support the approach.
  4. Send progress messages and the final PDF Blob back to the page.
  5. Keep DOM updates, download initiation, and cancellation controls on the main thread.

This can be worthwhile for very heavy, repeatable exports, but it involves more engineering and may change fidelity. If selectable text, exact CSS fidelity, or complex fonts matter more than client-side execution, consider server-side generation or a browser-print workflow rather than forcing a DOM renderer into a worker architecture it was not designed to use.

Choose an approach for the document

Approach UI responsiveness DOM/CSS fidelity Effort Best fit
Smaller DOM and lower capture cost Often improves substantially High for retained content Low Most reports and dashboards
Sectioned export with yields Better between sections; each section can still be heavy Medium to high Medium Long reports with clear boundaries
Worker with compatible rendering Highest potential responsiveness Depends on serialization and renderer High Very heavy, repeatable exports
Server-side or print-oriented generation Page remains responsive during server work Depends on renderer; may improve text fidelity Medium to high, plus infrastructure Large documents or strict production output

Troubleshoot common export failures

The whole interface locks until the file downloads

Likely cause: one large synchronous capture or encoding task. Fix: reduce the selected element and image dimensions first; then split long documents into sections and yield between them. A promise around the same monolithic call is not a worker.

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

The export is blurry after performance changes

Likely cause: capture scale or source-image dimensions are too low for the output size. Fix: raise html2canvas.scale in measured increments, use appropriately sized source images, and verify both text and photographs at the intended print or screen size.

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.

Images are missing or capture takes unusually long

Likely cause: remote resources, especially cross-origin images or fonts, are unavailable, delayed, or incompatible with canvas capture. Fix: inspect the browser console and network requests, verify production CDN and CORS behavior, and use the same resource conditions in testing. Do not assume useCORS: true alone resolves every origin restriction.

Pages have awkward gaps or split content

Likely cause: broad page-break avoidance or conflicting break rules. Fix: remove unnecessary avoid-all behavior, define CSS break rules for known boundaries, and use explicit selectors for sections that must start before or after a break.

The worker version cannot render the element

Likely cause: the implementation passes a DOM element to code running outside the DOM. Fix: serialize the required data or prepare images on the main thread, then send only worker-compatible inputs. Confirm OffscreenCanvas and renderer compatibility in the actual browser matrix.

Progress stalls or appears inaccurate

Likely cause: the progress signal does not represent the costly capture stage, or a single section is much larger than the others. Fix: report completed sections as milestones, divide highly uneven sections further where practical, and label the display as estimated rather than promising a completion time.

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

Or skip the browser setup

If your goal is to capture a webpage as an image or PDF rather than export a DOM you already control, ScreenshotNeo offers a website screenshot API and MCP server. For example, make a single request with cURL:

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 API documentation for setup and options. Its clean-shot flow accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. This is a webpage-capture service, not a replacement for exporting an application-specific DOM representation already in your page.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.

Frequently Asked Questions

Does making the html2pdf call async stop the UI from freezing?

No. Async syntax sequences work but does not move DOM capture or other CPU-heavy operations off the main thread.

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

Will a Web Worker accept an HTMLElement?

No. Workers cannot directly access the DOM; send serializable content or prepared images instead.

Is lowering the html2canvas scale always the best fix?

No. It reduces pixel work but can make output less sharp; validate quality at the intended use size.

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.