DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
html2canvas

How to Make html2canvas and jsPDF Work Across Screen Sizes

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

To make html2canvas and jsPDF behave consistently across screen sizes, separate the job into two decisions: choose the browser viewport and layout used to render the page, then choose the PDF page geometry used to place that rendered image. Set an intentional export width instead of inheriting the visitor’s current window size, choose a raster scale for image clarity, and fit the canvas proportionally into the PDF. Tall content, cross-origin assets, and browser canvas limits need separate handling.

Why screen size changes the result

html2canvas renders an element from the DOM using browser-like dimensions. The rendering viewport can affect CSS media queries, so columns, cards, and typography may change when the user resizes a window or opens the page on a phone. Its windowWidth and windowHeight options control the window dimensions used for rendering. See the html2canvas configuration options.

jsPDF handles a different stage: it defines the destination PDF’s page format, orientation, and measurement units. A screenshot can therefore look correct in the browser but be stretched, cropped, or poorly scaled when placed into a PDF. The canvas’s pixel dimensions do not themselves define the PDF’s physical page size.

A reliable export makes both stages explicit: decide which responsive layout should appear, render the intended content at suitable pixel resolution, and then fit it into a page or paginate it deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

Choose the layout to export

Use a fixed report layout when the PDF should be consistent

If a report should retain a desktop-style layout even when someone exports it from a phone, use a purpose-built export element or cloned layout with a fixed width. Pass that width as windowWidth. Media queries in the cloned document will then resolve against the chosen export viewport rather than whatever screen the user happens to have.

For example, a report designed to be 1200 CSS pixels wide can be rendered with windowWidth: 1200. That value is an example, not a required setting: choose a width that matches your own export design and test the resulting layout. Avoid forcing the visible page itself to resize just to capture it. html2canvas provides onclone so you can alter the cloned document used for rendering without changing the user’s live page.

Use the current responsive layout when that is the goal

If the PDF is meant to mirror what the visitor sees on their device, pass the relevant current viewport dimensions rather than a fixed desktop width. Expect the PDF composition to vary across devices because responsive breakpoints may select different layouts. This can be appropriate for a snapshot, but it is usually not the right default for a standardized invoice, report, or printable document.

Set capture bounds intentionally

Capture a specific export element rather than the entire page when possible. Set its dimensions or use an element designed for export, and decide whether the capture should include all of its content. For tall content, windowHeight can be set to the element’s scrollHeight; the html2canvas FAQ discusses matching rendering window dimensions to the element’s scroll dimensions when dealing with large captures.

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.
Rank #2
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

Choose raster resolution separately

The scale option controls how many canvas pixels are rendered for each CSS pixel; it does not determine the PDF page’s physical size. html2canvas documents window.devicePixelRatio as its default scale. A larger scale can make text and edges look sharper in the resulting raster image, but it also increases pixel dimensions, processing, and memory use. See the project’s examples.

Choose scale by inspecting the image at its final PDF size. If the image looks soft, a higher scale may help, provided the browser can render the larger canvas. If rendering becomes slow, memory-heavy, blank, or clipped, reduce the scale, capture smaller sections, or both. There is no single scale that guarantees the right balance for every browser and document.

Fit the canvas to a PDF page

Create jsPDF with an explicit orientation, unit, and page format. After rendering the canvas, calculate its aspect ratio and use that ratio to place it within the page’s usable area. If the canvas is wider than the printable area, fit it to the page width and derive the corresponding height. If it is taller, constrain it by the usable page height instead. Do not assign an unrelated width and height that distort the image.

The following is a geometry illustration, not a tested drop-in implementation. It places one canvas on an A4 portrait page in millimetres, fitting the canvas width to the page. For production output, account for margins and pagination. The jsPDF project documents page sizing and image insertion in its repository and documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.
const canvas = await html2canvas(exportElement, {
  windowWidth: EXPORT_LAYOUT_WIDTH,
  windowHeight: exportElement.scrollHeight,
  scale: 2,
  useCORS: true,
});

const pdf = new jsPDF({
  orientation: "portrait",
  unit: "mm",
  format: "a4",
});

const pageWidth = pdf.internal.pageSize.getWidth();
const imageHeight = canvas.height * pageWidth / canvas.width;
pdf.addImage(canvas, "PNG", 0, 0, pageWidth, imageHeight);
pdf.save("report.pdf");

This example assumes html2canvas and jsPDF have already been imported and exportElement and EXPORT_LAYOUT_WIDTH are defined. A one-page fit can extend beyond the page if the content is tall; use a pagination strategy rather than shrinking the entire document until its text becomes unreadable.

Make tall content readable across pages

A tall canvas is not automatically a good multipage document. If the whole canvas is scaled down to fit one page, text may become too small. If it is placed at full width on one page, its bottom may run beyond the page. Decide where pages should break before generating the PDF.

Capture sections at planned boundaries

For reports with natural sections, capture each section separately and add it to a page at a controlled position. When a section will not fit in the remaining usable page area, add a page and continue. This gives you control over headings, charts, and other elements that should not be split awkwardly.

Slice a rendered image only when breaks are acceptable

You can render a tall image and divide it into page-sized slices, but a simple slice can cut through a paragraph, table row, or chart. Use this approach only if the resulting breaks are acceptable, or add logic to choose boundaries that avoid splitting important content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Liene Amber M110 Bluetooth Photo Printer 80 Sheets, Portable Photo Printer for iPhone, Thermal Dye Sublimation, Picture Printer 60 Sheets 4x6 Paper & 20 Sheets 3" Square Sticker Paper & 2 Cartridges
  • Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
  • Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
  • Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.

Use a document layout when selectable text matters

html2canvas turns the rendered page into pixels. If the PDF must have selectable text or structured content, an image-based capture may not meet the requirement; use a PDF-generation approach that lays out text and graphics as PDF elements instead. The choice depends on whether visual fidelity to the browser or text structure is more important.

Handle remote images, fonts, and other assets

Browser security rules affect whether cross-origin images can be included in a canvas that you later read or serialize. Setting useCORS: true asks html2canvas to use CORS for images; the image server must still grant the required access in its response headers. If it does not, use same-origin assets or an appropriate proxy that you are authorized to operate. The html2canvas FAQ covers cross-origin and rendering limitations.

allowTaint is not a workaround when you need to read or serialize the canvas: browser restrictions still matter. Test the actual images, fonts, and styles used in the export, not just a page made entirely of local assets. A font that loads late or an image that has not finished loading can also produce a capture that differs from the visible page.

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

Common problems and fixes

Symptom Likely cause What to check
Cards or columns reflow in the PDF The cloned render uses a viewport that activates different media queries, or the captured element has unexpected dimensions. Inspect windowWidth, windowHeight, the export element’s dimensions, and the responsive breakpoints. Use an explicit export width if the layout must be consistent.
Text and images look soft The canvas has too few pixels for its final placement size, or the image is being enlarged in the PDF. Check scale and the canvas-to-page dimensions. Increase scale only if memory and processing costs remain acceptable.
Remote images are missing The image server does not grant the browser’s required CORS access, or the image cannot be fetched as configured. Check the image response’s CORS headers and the useCORS or proxy setup. Do not rely on allowTaint if the canvas must be serialized.
Output is blank or truncated The capture may be too large for the browser’s canvas resources, or rendering dimensions do not cover the element. Inspect the canvas dimensions, try setting windowWidth and windowHeight to match the element’s scroll dimensions, reduce scale, or capture in sections. Test on the browsers and devices you support.
Image is cropped or runs past the PDF page The PDF page units or dimensions were not considered, or the image was given dimensions that do not preserve its ratio. Check the chosen jsPDF page format, orientation, and units. Recalculate width and height proportionally within page margins, and paginate tall output.

Performance, reliability, and cost in your own application

Rendering happens in the visitor’s browser, so large DOM trees, high scale, remote assets, and very tall captures can increase processing time and memory demand. Keep the export element limited to what the PDF needs, wait for required assets before capture, and avoid rendering the same large content repeatedly when the result can be reused. A cache or saved export can reduce redundant work in an application, but it does not remove the need to validate the captured output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

There is no universal browser canvas maximum established here, and behavior can vary with browser, device resources, content, and installed library versions. Test representative documents in the target browsers and devices. Confirm that the installed html2canvas and jsPDF versions support the options you use; the documentation pages describe API behavior but do not establish a single compatibility result for every version and browser.

Or skip the browser setup

If your actual goal is a website screenshot or PDF from a URL rather than a PDF of a local application’s DOM, ScreenshotNeo is a website screenshot API and MCP server. One request returns a PNG, JPEG, WebP, or PDF; it is an alternative to building and maintaining a browser capture path in your own application. It does not replace html2canvas when you need to render a particular in-page DOM element controlled by your app.

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

See the ScreenshotNeo API documentation for request options and response details. Its capture can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools 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.

Sign up for 1,000 free screenshots a month, with no card required.

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

Frequently Asked Questions

Does setting html2canvas scale change the PDF paper size?

No. Scale changes the rendered canvas pixel dimensions; jsPDF’s format, orientation, and units determine the PDF page geometry.

Can I use html2canvas to create selectable PDF text?

html2canvas renders pixels. For selectable text and structured PDF content, use a PDF-generation method that creates text and graphics as PDF elements.

Can I make a website screenshot and PDF without rendering my app’s DOM?

Yes. ScreenshotNeo accepts a URL and can return an image or PDF; it is suited to URL-based captures, not to capturing an arbitrary DOM element from your application.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.