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

First decide whether you need one raster image or whether a PDF is acceptable. Apple provides an asynchronous image snapshot API and a separate PDF-export API. Android documents a deprecated full-document picture method, recommends drawing the WebView into a bitmap for image snapshots, and provides a print adapter for PDF output. None of these references guarantees identical behavior for lazy loading, nested scrollers, cross-origin frames, very tall pages, or every operating-system version, so validate the pages and OS versions your app supports.

Choose the output before choosing an API

A PNG, JPEG, or other bitmap is appropriate for sharing, visual regression tests, thumbnails, and image annotation. A PDF is usually better for long documents because it avoids creating one extremely tall bitmap and preserves a document-oriented layout. Treat PDF export as a separate path, not as a screenshot with a different file extension.

Platform Raster-image route PDF/document route Important qualification
iOS WKWebView.takeSnapshot(with:completionHandler:) or its async form WKWebView.createPDF(configuration:) The snapshot configuration selects the portion of the view; the cited API description does not establish a universal full-document bitmap recipe.
Android Draw the WebView into a bitmap-backed Canvas with onDraw(Canvas) createPrintDocumentAdapter(String) capturePicture() describes entire-document capture but has been deprecated since API 19.

iOS: capture a WKWebView image

What Apple’s API does

Apple describes takeSnapshot as generating a platform-native image from the web view’s contents. The asynchronous completion supplies either an image or an error, so production code must handle both. WKSnapshotConfiguration controls the portion of the WebView to capture and related behavior.

Swift implementation

Call the API after navigation has finished and after your own page-readiness checks. The following example captures the configured WebView area and writes a PNG:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
  • This phone is unlocked and compatible with any carrier of choice on GSM and CDMA networks (e.g. AT&T, T-Mobile, Sprint, Verizon, US Cellular, Cricket, Metro, Tracfone, Mint Mobile, etc.).
  • Please check with your carrier to verify compatibility.
  • The device does not come with headphones or a SIM card. It does include a generic (Mfi certified) charging cable.
  • Tested for battery health and guaranteed to have a minimum battery capacity of 80%.
import WebKit

func capture(webView: WKWebView) {
    let configuration = WKSnapshotConfiguration()
    // Configure the snapshot's rect or other supported properties here.

    webView.takeSnapshot(with: configuration) { image, error in
        DispatchQueue.main.async {
            if let error = error {
                print("Snapshot failed: (error.localizedDescription)")
                return
            }
            guard let image = image,
                  let data = image.pngData() else {
                print("Snapshot returned no image data")
                return
            }
            do {
                let url = FileManager.default.temporaryDirectory
                    .appendingPathComponent("webview.png")
                try data.write(to: url)
                print("Saved to (url)")
            } catch {
                print("Could not save image: (error)")
            }
        }
    }
}

The API is asynchronous; do not assume the file is ready immediately after calling it. Also do not assume that a viewport-sized WebView automatically yields every pixel of a document several screens tall. Define the capture region deliberately, and test the actual page, including content below the initial viewport.

When PDF is the better iOS result

If a document is acceptable, use Apple’s separate createPDF(configuration:) API. It produces PDF data from WebView contents and avoids treating a long document as one giant raster allocation. Handle its asynchronous result and write the returned data to a file or share sheet. This is document export, not a guarantee that the PDF and a bitmap screenshot will have identical pagination or fixed-element behavior.

Android: capture WebView content

Do not make capturePicture the default

Android marks WebView.capturePicture() deprecated beginning with API 19. The reference describes it as capturing the entire displayed document, but also records historical limitations involving fixed-position elements and scrollable divisions on older Android releases. It must run on the UI thread, and the returned picture is drawn into a bitmap-backed Canvas on Jelly Bean MR1 and later. Use it only when maintaining legacy code that has been tested on your supported devices.

Rank #2
Apple iPhone 16, 128GB, Pink - Unlocked (Renewed)
  • 6.1" Super Retina XDR OLED, HDR10, Dolby Vision, 1000nits (typ), 2000nits (HBM), 2556x1179px at 460ppi, 3561mAh Battery
  • 128GB 8GB RAM, Apple A18 (3nm), Hexa-core (2x4.04 GHz + 4x2.20 GHz), Apple GPU 5-core, 16‑core Neural Engine
  • Rear camera: 48MP, f/1.6, wide + 12MP, f/2.2, ultrawide, Front Camera: 12MP, f/1.9, wide, iOS 18, upgradable to iOS 18.5
  • 4G LTE: 1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/48/53/66/71, 5G: n1/2/3/5/7/8/12/14/20/25/26/28/29/30/38/40/41/48/53/66/70/71/75/76/77/78/79 - Dual eSIM
  • Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Sprint., Etc.

Bitmap snapshot with onDraw

The Android reference recommends onDraw(Canvas) for obtaining a bitmap snapshot. This is a drawing technique, not a documented promise of an off-screen, full-document image. The bitmap dimensions and what is currently laid out must be chosen and verified by your app.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
fun snapshotVisibleWebView(webView: WebView): Bitmap {
    check(Looper.myLooper() == Looper.getMainLooper()) {
        "WebView drawing must run on the UI thread"
    }

    val width = webView.width
    val height = webView.height
    require(width > 0 && height > 0) { "WebView has no laid-out size" }

    val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
    val canvas = Canvas(bitmap)
    webView.draw(canvas)
    return bitmap
}

Save the returned bitmap with compress, and release it when finished. For a page taller than the viewport, first establish a tested strategy: resize the WebView, capture in scroll segments and stitch them, or choose PDF. The supplied API description does not define a universal full-page configuration for onDraw.

PDF export with createPrintDocumentAdapter

createPrintDocumentAdapter(String) converts WebView contents to a PDF stream. Android’s reference recommends a dedicated off-screen WebView for printing and notes that the WebView cannot be drawn during conversion. Build a print adapter from that dedicated instance, connect it to your app’s PrintAttributes and ParcelFileDescriptor through the Android printing callbacks, then close the descriptor after writing completes. Keep this pipeline separate from bitmap capture.

Rank #3
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
  • 6.1inch Super Retina XDR display. Aluminum with color-infused glass back. Ring/Silent switch
  • Dynamic Island. A magical way to interact with iPhone. A16 Bionic chip with 5-core GPU
  • Advanced dual-camera system. 48MP Main | Ultra Wide. Super-high-resolution photos (24MP and 48MP). Next-generation portraits with Focus and Depth Control. 4X optical zoom range
  • Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
  • Up to 26 hours video playback. USB C, Supports USB 2. Face ID

Make the page capture-ready

  • Wait for navigation completion and then wait for application-specific readiness, such as a known selector, image decode completion, or an explicit JavaScript signal.
  • Exercise lazy-loaded images, infinite lists, nested scroll containers, sticky and fixed elements, cross-origin frames, web fonts, and pages with large or unusual dimensions.
  • Test on every iOS and Android version you claim to support. API documentation alone does not establish identical rendering across releases.
  • Decide how to handle failed navigation, authentication, consent dialogs, bot checks, blank responses, and network timeouts before saving an image.
  • Measure memory on representative devices. A single very tall ARGB bitmap can be expensive; PDF or tiled capture may be safer.

iOS and Android routes compared

Question WKWebView Android WebView
Native image API Asynchronous takeSnapshot; returns an image or error. onDraw(Canvas) is the documented bitmap-snapshot direction; exact full-page behavior requires validation.
Explicit capture scope WKSnapshotConfiguration specifies the portion captured. capturePicture has a historical entire-document description but is deprecated; onDraw scope depends on your drawing setup.
PDF createPDF creates PDF data. createPrintDocumentAdapter supplies content for a PDF stream.
Completion and errors Asynchronous completion; check image and error. Printing is callback-based; bitmap drawing and file operations must be coordinated on appropriate threads.
Main risk to validate Whether the chosen configuration includes the entire document and dynamically loaded content. Deprecated legacy behavior, document height, nested scrolling, and bitmap memory.

Troubleshooting

The image contains only the viewport

That is expected when the configured or drawn area is viewport-sized. Verify the dimensions and capture strategy; do not infer full-page support from a successful visible snapshot. For very long content, evaluate PDF or tested tiled capture.

Images or fonts are missing

The page was captured before resources finished loading. Add a readiness signal in the page, wait for the relevant elements, and test image decoding and web-font completion on slower networks.

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.

Sticky headers appear repeatedly or in the wrong place

Fixed-position behavior differs between capture approaches and historical Android versions. Reproduce on each supported OS, then choose a capture method whose output matches your requirement; the references do not promise a universal correction.

Rank #4
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
  • This pre-owned product is not Apple certified, but has been professionally inspected, tested and cleaned by Amazon-qualified suppliers.
  • There will be no visible cosmetic imperfections when held at an arm’s length.
  • This product is eligible for a replacement or refund within 90 days of receipt if you are not satisfied.
  • Product may come in generic Box.

Android capture fails or behaves differently on devices

Check that WebView work runs on the UI thread, that the view has a nonzero laid-out size, and that you are not relying on deprecated capturePicture() for new code.

PDF generation is blank or incomplete

Use a dedicated off-screen WebView for Android printing as the reference recommends, wait for content readiness, and keep the WebView available until print conversion callbacks finish. On iOS, check the asynchronous PDF result and error before writing data.

The app runs out of memory

Reduce bitmap dimensions, capture tiles, recycle or release intermediate images, or switch to PDF. Avoid allocating a full-document bitmap until you have measured the largest pages your app will process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Apple iPhone 16e, 128GB, Black - Unlocked (Renewed)
  • 6.1" Super Retina XDR OLED, HDR10, 800 nits (HBM), 1200 nits (peak), 2532x1170px at 460ppi, 4005mAh Battery
  • 8GB RAM, Apple A18 6-core CPU (2 performance + 4 efficiency cores), Apple GPU 4-core, 16‑core Neural Engine
  • Rear camera: 48MP, f/1.6, wide, Front Camera: 12MP, f/1.9, wide, iOS 18.3.1, upgradable to iOS 18.5
  • Connectivity: Global 4G LTE, Sub-6 GHz 5G, LTE, Wi-Fi 6, Bluetooth 5.3, NFC, USB-C, Wireless Charging (7.5W). (does not have mmWave 5G or MagSafe or physical SIM card) - Dual eSIM Only
  • Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Straight Talk., Etc.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server when the target is a URL rather than an in-app WebView. Its endpoint can return PNG, JPEG, WebP, or PDF, with full-page capture, lazy-image loading, CSS-selector element capture, device and retina settings, custom CSS or JavaScript, waits, cookies and headers, request blocking, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous webhooks, bulk capture, and a usage API.

Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

Use the ScreenshotNeo API documentation for authentication and options. A cURL request is:

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 shots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Sign up free for ScreenshotNeo.

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

FAQ

Is a WebView screenshot the same as a browser screenshot?

No. Rendering, available APIs, viewport setup, and document handling depend on the platform WebView and your configuration. Validate the exact page and OS combinations you support.

Should I store a PDF or an image for archival?

Choose PDF when document flow and manageable long-page output matter; choose an image when pixel-level raster output is the requirement.

Can these APIs capture cross-origin iframes?

The cited references do not establish a universal result. Include cross-origin frames in your test matrix and treat any observed behavior as platform- and page-dependent.

Quick Recap

Bestseller No. 1
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
Apple iPhone 14, 128GB, Midnight - Unlocked (Renewed)
Please check with your carrier to verify compatibility.; Tested for battery health and guaranteed to have a minimum battery capacity of 80%.
$299.00
Bestseller No. 3
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
Apple iPhone 15, 128GB, Black - Unlocked (Renewed)
Dynamic Island. A magical way to interact with iPhone. A16 Bionic chip with 5-core GPU; Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
$400.00
Bestseller No. 4
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
Apple iPhone 13, 128GB, Midnight - Unlocked (Renewed)
There will be no visible cosmetic imperfections when held at an arm’s length.; Product may come in generic Box.
$262.00

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.