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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

For a browser-side PDF download, use html2pdf.js to convert a specific DOM element containing the form content. It combines html2canvas and jsPDF; you select the element, configure the output, and save the PDF in the browser. The important detail is to prepare a document-specific element with the values you want included rather than assume the browser will render every live form control exactly as intended.

Choose what the PDF should contain

A web form has two different representations: the controls a person edits, and the document you want them to keep. Those are not always identical. A text input may show a current value in the browser while a conversion library renders its markup in a way you did not expect. Long answers can also need different layout from the compact controls used on screen.

A reliable approach is to make a dedicated printable element and fill it with the submitted values as ordinary text and document markup. Convert that element, not the whole page. This also keeps navigation, buttons, validation messages, and unrelated page content out of the PDF. Inspect the generated document in the browsers and with the kinds of form values your application actually accepts.

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

Load html2pdf.js in a browser page

The documented html2pdf.js workflow is browser-side; its README says it does not run in Node.js. Make the browser build available to the page using the project’s documented distribution method, then call its html2pdf global after that script has loaded. The example below assumes that setup and uses the documented worker chain, .set(options).from(element).save().

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner
  • PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
  • QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
  • VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
  • INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
  • EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0

It includes a small form and a separate print area. When the user chooses Download PDF, JavaScript copies the submitted values into the print area and asks html2pdf.js to save it as completed-form.pdf. Adapt the fields and labels to your form.

<form id="request-form">
  <label>
    Name
    <input name="name" required>
  </label>
  <label>
    Email
    <input name="email" type="email" required>
  </label>
  <label>
    Request details
    <textarea name="details" required></textarea>
  </label>
  <button type="submit">Download PDF</button>
</form>

<section id="form-content"></section>

<script>
  const form = document.getElementById('request-form');
  const formContent = document.getElementById('form-content');

  form.addEventListener('submit', (event) => {
    event.preventDefault();

    if (!form.reportValidity()) return;

    const values = new FormData(form);
    const heading = document.createElement('h1');
    heading.textContent = 'Request summary';
    formContent.replaceChildren(heading);

    for (const [label, value] of [
      ['Name', values.get('name')],
      ['Email', values.get('email')],
      ['Request details', values.get('details')]
    ]) {
      const section = document.createElement('section');
      const title = document.createElement('h2');
      const text = document.createElement('p');
      title.textContent = label;
      text.textContent = String(value ?? '');
      section.append(title, text);
      formContent.append(section);
    }

    const options = {
      filename: 'completed-form.pdf',
      margin: 0.5,
      pagebreak: { mode: ['css', 'legacy'] },
      jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
    };

    html2pdf().set(options).from(formContent).save();
  });
</script>

The code uses textContent for user-entered values, so text is treated as text rather than inserted as HTML markup. For checkboxes, radio groups, select fields, repeated rows, or file inputs, add explicit logic that represents the submitted value the way you want a reader to see it. A file input, for example, does not automatically mean the file’s contents belong in the PDF.

Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
  • READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
  • WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
  • OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)

Set page size, margins, and page breaks

html2pdf.js documents options for the output filename, margins, image type and quality, page-break behavior, html2canvas, and jsPDF page settings. The example chooses a filename, half-inch margins, Letter paper, and portrait orientation; those are example choices, not universal defaults for every document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Paper and orientation: choose a jsPDF format and orientation that suit the form. Wide tables or landscape-oriented content may need a different layout from a short portrait form.
  • Margins: leave enough space around content so text and borders do not sit at the page edge. Check the result rather than assuming one margin will suit every paper size.
  • Page breaks: the example enables CSS and legacy page-break modes. Use print-oriented CSS where appropriate and test long entries; a page break that works for one form length may split a section when values grow.
  • Image output: the options include image type and quality. Forms with logos or other visual content may benefit from tuning these settings, but higher image quality can affect output size. Review both legibility and file size.

For instance, a long answer should not be allowed to push a label onto one page and its value onto another if that makes the document hard to read. Add appropriate document styles and page-break rules to the printable element, then inspect PDFs with short and long answers, empty optional fields, and repeated content.

Rank #3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
  • STAY ORGANIZED – Easily convert your paper documents into digital formats like searchable PDF files, JPEGs, and more.Power Consumption : 2.5W or less (Energy Saving Mode: 0.7W). Suggested Daily Volume : 500 scans..Does it contain liquid: no
  • CONVENIENT AND PORTABLE –lightweight and small in size, you can take the scanner anywhere from home offices, classrooms, remote offices, and anywhere in between
  • HANDLES VARIOUS MEDIA TYPES – Digitize receipts, business cards, plastic or embossed cards, reports, legal documents, and more
  • FAST AND EFFICIENT – No technical hurdles or complicated setups here; easily scan both sides of a document at the same time, in color or black-and-white, at up to 12 pages-per-minute, and with a 20 sheet automatic feeder
  • BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer

Understand rendering and PDF fidelity

html2pdf.js uses html2canvas and jsPDF for its documented conversion route. This is HTML rendering into a PDF, not a guarantee that the result has the same structure and behavior as a natively authored PDF.

  • Cross-origin content: html2canvas documents browser security restrictions: it cannot render cross-origin iframe content because the browser does not expose that iframe’s contentDocument. A canvas tainted by cross-origin content cannot be read. If an embedded item is absent, investigate its origin and browser access rather than assuming a page-break or PDF setting will fix it.
  • Selectable text and accessibility: the reviewed project documentation does not guarantee selectable text or an accessible PDF structure. Check the actual output against your requirement; do not promise either property based solely on the fact that the file is a PDF.
  • Interactive fields: the documented HTML conversion does not establish that the PDF will contain editable PDF form fields. If recipients must fill in or sign fields in a PDF viewer, treat that as a separate requirement and verify the generated file.
  • Browser and layout variation: the cited documentation does not provide a current browser-version support matrix or controlled quality comparison. Test the browsers and page layouts your application supports instead of assuming identical output everywhere.

jsPDF also exposes an HTML method that accepts an HTML element or string, but its project documentation says that method depends on html2canvas too. It is another HTML-rendering entry point, not evidence that it avoids the same browser canvas restrictions.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • IRIScan Express, portable scanner : scans color and black and white documents a blazing speed up to 8ppm simplex. Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • IRIScan Express mobile scanner is powered via an included micro USB 2. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan. USB cable provided. AC Adapter not provided and not needed.
  • IRIScan flatbed scanner uses a simplex scanning mode allows for quick and straightforward scanning of single-sided documents. IRIScan with its full portable features is the ideal document scanners for computers.
  • IRIScan document scanner : Versatile scanning capabilities, including scanning to Word, PDF, and Excel formats with companion software provided Readiris OCR
  • Receipt scanner and card scanner with Additional features include scanning business cards directly to Outlook, photo scanning, and receipt scanning for efficient document management

Troubleshoot a missing, incomplete, or awkward PDF

Symptom Likely cause What to check
html2pdf is undefined The browser library has not loaded when the handler runs, or the page is using the wrong distribution setup. Confirm the browser build is loaded before this code executes and that the script exposes the documented global.
The PDF is blank or missing the form values The wrong element was passed, the print area was not populated, or conversion began before content was ready. Confirm form-content exists, inspect its contents immediately before .from(), and ensure values are added before calling .save().
A field’s visible value is absent or wrong The conversion is rendering live controls differently from the intended document representation. Copy submitted values into the dedicated printable element as text or document markup, then test the actual PDF.
An iframe or remote visual item is missing Browser cross-origin restrictions prevent html2canvas from reading the content. Check whether the content is cross-origin or taints a canvas. Do not rely on the converter to bypass browser security boundaries.
Text or sections are clipped or split badly Content length, page size, margins, or break rules do not fit the chosen layout. Test longer field values, adjust document styles and page-break behavior, and inspect each page at the intended paper size.
The PDF is hard to read or unusually large Image rendering settings or the source layout may not suit the document. Review the documented image type and quality options, then balance legibility against file size using your own output.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, privacy, and deployment considerations

Because this workflow runs in the browser, conversion work happens on the user’s device rather than in a Node.js process. The documentation does not establish a universal conversion time or a performance limit; large forms and visual content should be tested on the devices and browsers relevant to your users. Keep the conversion action tied to a clear user gesture, and avoid building a huge hidden document if only a concise summary belongs in the download.

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.

The example prevents the form’s default submit action and performs the conversion in the page. That alone does not establish how your application handles the data: any separate submit request, analytics code, or storage behavior remains your responsibility. If the form contains sensitive information, review the full page’s data flows and ensure the PDF only includes fields the user is meant to export.

Best Value
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

Or skip the browser setup

If your form is already published at a URL and you want a rendered capture of that page, ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. It can return screenshots or PDFs; the example below uses the supplied one-call screenshot request and saves its default image output. This captures a URL, not unsaved values from a local form or arbitrary DOM content. Use the DIY method above for those cases. See the ScreenshotNeo documentation for PDF output and supported request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/your-form -o shot.webp

Before capture, ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

The free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and yearly billing gives two months free. Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

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

Frequently Asked Questions

Does converting the form this way submit its data to my server?

The demonstrated conversion is performed in the browser and the code prevents the form’s normal submit action. Whether your page separately transmits or stores data depends on the rest of your application.

Can I use ScreenshotNeo to export values that a visitor has not submitted?

The shown ScreenshotNeo request captures a page at a URL. It is not a method for reading unsaved values from a visitor’s local form; use the browser-side DOM workflow for that case.

Quick Recap

Bestseller No. 3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer; This product is not intended for scanning photographs on photo paper / photographic media
$184.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.00
Bestseller No. 5
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.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.