Scan to PDF in your browser — built for India after the CamScanner ban
On 29 June 2020 the Ministry of Electronics and Information Technology, acting under Section 69A of the Information Technology Act, 2000, blocked 59 mobile apps of Chinese origin in India. The list included CamScanner — the document scanner that, by its own pre-ban marketing, claimed more than 100 million installs in India alone. The ban order, summarised in the Press Information Bureau release of 2 July 2020, cited "activities prejudicial to sovereignty and integrity of India, defence of India, security of state and public order" and called out the apps' transmission of user data to servers outside India.
The ban left a real hole. CamScanner's use case — point your phone at an Aadhaar, a PAN card, a GST invoice, a bank passbook page, or an HR onboarding form, and get back a flat, perspective-corrected, shareable PDF — was not optional for most knowledge workers and small-business owners. Replacement apps from Indian developers shipped quickly, but the underlying privacy concern stayed: a native app sees everything in your camera roll and runs background processes you cannot easily audit.
Scan to PDF at pdfmavericks.com sidesteps the entire app-installation question. It runs in the browser tab. There is no installer, no background service, no telemetry of your scans, and the camera feed never leaves your device. Open DevTools, switch to the Network panel, and filter by XHR — you will see zero outbound requests as you capture pages. The PDF is built locally with pdf-lib and downloaded directly from your browser's File API.
How the scanner works
When you tap Open camera, the page calls navigator.mediaDevices.getUserMedia({ video: { facingMode: "environment" } }). That is the W3C Media Capture standard, supported in Chrome and Firefox on Android since 2017 and in iOS Safari since 14.3 (released December 2020). The browser shows the standard permission prompt, and on approval streams the rear-camera feed into a hidden <video> element on the page.
In parallel, the page lazy-loads OpenCV.js — about 8 MB of WebAssembly, fetched from the official OpenCV CDN (docs.opencv.org/4.10.0/opencv.js) and cached by the browser for the rest of the session. This is a one-time cost, only paid when you actually use the scanner. The homepage, the Compress PDF tool, the Merge PDF tool, and every other route on PDF Mavericks ship the same 104 kB baseline JavaScript bundle — none of them pull OpenCV.
Once OpenCV is ready, an animation loop runs on the live camera feed at roughly 10 frames per second: convert the frame to grayscale, blur it with a 5×5 Gaussian kernel, run Canny edge detection (thresholds 75 and 200), find contours, and pick the largest 4-vertex polygon whose area exceeds 10% of the frame. That polygon is drawn back as an orange overlay so you know what the scanner is locked onto.
When you tap Capture page, the current frame is snapshot to a full-resolution canvas. The same edge-detection pipeline runs once more — this time on the full-resolution image — followed by cv.getPerspectiveTransform and cv.warpPerspective. The result is a flat rectangle of just the document, with the angle of the original photograph corrected. The Auto filter then applies an adaptive Gaussian threshold (block size 15, constant 10) to make black-on-white text crisp even when the ambient lighting was uneven. Color and Grayscale filters are also available per page.
When the camera is the wrong tool
Cameras fail in three predictable ways: low ambient light, low contrast between the document and the surface beneath it, and motion blur from a shaky hand. If the orange overlay does not lock onto the document boundary, move to a brighter spot, place the document on a contrasting surface, and hold the phone parallel to the page. If you already have JPEGs or PNGs of the document — say, photos taken in your phone's native camera app — use the Upload photos instead fallback. The same edge-detect plus perspective-warp pipeline runs on uploaded images, so the output PDF looks identical to a fresh camera scan.
For PDFs of physical scans where the page is already flat but the text is small or in a regional language, consider running the result through OCR PDF so the text is searchable. For Aadhaar specifically, after scanning to PDF you can pipe the file through Aadhaar Masking to hide the first eight digits per the UIDAI Masked Aadhaar guideline before sharing the document with anyone.
Privacy in practice
"Browser-local" is a technical claim and you do not have to take it on faith. Here is the audit trail anyone can run before trusting the tool with a salary slip or a board resolution:
- Open the page, then open DevTools (F12 on most browsers), and go to the Network tab. Filter by
Fetch/XHR. Capture three pages. The filter will stay empty. - Switch to the Img filter — you will see the OpenCV.js fetch from
docs.opencv.orgon first scan, and then nothing else as you keep scanning. That is the browser pulling the WebAssembly engine; no images are sent the other way. - Inspect the Build PDF button in the DOM. The click handler calls a local function that produces a Blob and triggers
URL.createObjectURL. There is nofetchcall, noXMLHttpRequest, no WebSocket. The PDF is born and dies in your tab. - Disconnect from the internet after the page loads (and after OpenCV.js finishes its initial download). The scanner keeps working — proof that no server round-trip is required.
Indian regulatory context
The 2020 ban was not a one-off event. The IT (Procedure and Safeguards for Blocking for Access of Information by Public) Rules, 2009 (notified under Section 69A of the IT Act) give the government standing authority to block apps that route Indian-user data to foreign servers without adequate safeguards. CamScanner returned to the Play Store in mid-2022 under a different corporate structure, but the underlying regulatory posture has not softened — the Digital Personal Data Protection Act, 2023, raises the cost of cross-border processing further. For Aadhaar specifically, the UIDAI's Authentication Regulations impose strict handling rules on any system that touches Aadhaar numbers; the safest position for a small business is to never send the raw number to a third-party server in the first place.
A browser-local scanner is the simplest way to satisfy that posture. The data plane stops at your device; there is no third-party processor in the loop, so there is nothing to audit, nothing to indemnify, and nothing to disclose under the 2023 Act's breach-notification rules.
Common scanning workflows
- Salary slip month-end pack: capture each month's slip with the Auto filter, then merge the PDFs into a single annual file before sending to your CA.
- Multi-page GST invoice: scan the original, then scan the appendix sheets in the same session. One PDF, one upload to the GSTN portal.
- iPhone with HEIC photos already on the device: use the HEIC to PDF tool — it skips the camera step entirely and runs straight from the .HEIC files.
- Document is password-protected after scanning: if your scanner-app workflow encrypted an existing PDF and you have the password, run it through Unlock PDF before re-scanning the unlocked pages here.
- Aadhaar copy for KYC: scan, then run through Aadhaar Masking to hide the first eight digits before emailing.
Frequently asked questions
- Why was CamScanner banned in India and is a browser scanner a good replacement?
- On 29 June 2020 the Government of India invoked Section 69A of the IT Act and blocked 59 Chinese-origin apps including CamScanner — the order cited threats to sovereignty, integrity, defence, security, and public order, and called out the apps' background data transmission to servers outside India (Press Information Bureau, 2 July 2020). A browser-based scanner avoids the same risk class entirely: there is no native app installed, no background process, and the camera feed and scanned pages never leave your device. You can verify this in DevTools by opening the Network tab and watching it stay silent while you scan.
- Does my Aadhaar, PAN, or GST invoice get uploaded to your server?
- No. The page runs entirely in your browser. The camera frame is captured to a local canvas, OpenCV.js runs the edge detection on that canvas, and pdf-lib builds the final PDF in memory before triggering a download. The site has no upload endpoint for this tool. If you want proof, open DevTools, go to the Network tab, filter to XHR/Fetch, and scan a page — you will see zero requests carrying image data.
- Does this work on iOS Safari?
- Yes for iOS 14.3 and newer. Apple shipped getUserMedia with rear-camera access in Safari 14.3 (December 2020). On older versions, the camera permission prompt either does not appear or only the front-facing camera is exposed — in that case use the file-upload fallback (Photos app → share to Safari → upload). Chrome and Firefox on Android have supported the rear camera since 2017 and work fine.
- What about the 8 MB OpenCV.js download — is that paid every visit?
- It loads on demand, only when you actually open the camera or upload a photo, and only once per browser session. Subsequent visits hit the browser cache and load instantly. Other tool pages on PDF Mavericks do not pull OpenCV — they share the same 104 kB baseline JavaScript. You only pay the download when you choose to scan.
- How accurate is the edge detection in low light?
- It works well on a contrasting background — a sheet of A4 on a dark wooden desk, for example. In low light the detector falls back to the raw frame. If the orange overlay does not lock onto the document, move to better lighting, hold the phone steady, and make sure all four corners are inside the viewfinder. The Auto filter then runs an adaptive threshold so the text remains crisp even on a less-than-perfect crop.
- Can I rearrange or delete pages before I download?
- Yes — the page list shows each captured scan in order with a remove button. Re-applying a filter (Auto, Color, Grayscale) on any single page reprocesses just that page. To reorder, remove and recapture, or use the Upload Photos fallback to add scans in a specific order.
Sources: Press Information Bureau release on the 29 June 2020 app ban (PIB ID 1635206, dated 2 July 2020); Section 69A of the Information Technology Act, 2000; W3C Media Capture and Streams specification; OpenCV documentation for adaptive thresholding and perspective transforms.