Đặt giấy lên mặt phẳng, đưa vào khung hình — ứng dụng sẽ tự lấy nét và tự chụp khi ảnh đủ rõ.
Kim – Thổ: vàng kim, trắng ngà, nâu đất; tránh đỏ, cam, hồng, tím.
Đặt máy cố định (giá đỡ), lật trang theo nhịp – app tự chụp sau mỗi khoảng thời gian, không giới hạn số trang.
Làm một lần, khoảng 10 phút, miễn phí. Bạn tự tạo "chìa khoá" (Client ID) để app được phép lưu file vào Drive của bạn. Không cần server, không có khoá bí mật nào nằm trong app.
Đăng nhập bằng Gmail sẽ dùng để lưu file → tạo project mới, đặt tên tuỳ ý (VD DocScan) → Create. Các bước sau nhớ chọn đúng project này ở thanh trên cùng.
Mở trang Google Drive API → bấm Enable (nếu thấy Manage là đã bật rồi).
Branding: điền App name (VD DocScan), User support email, Developer contact → Save. Audience: chọn External. Rồi chọn một trong hai:
drive.file
Data Access → Add or remove scopes → tìm và tích .../auth/drive.file → Update → Save.
.../auth/drive.file
Clients → Create client → Application type: Web application → đặt tên. Mục Authorized JavaScript origins → Add URI → dán đúng địa chỉ app này:
Chỉ ghi giao thức + tên miền (+ cổng), không có dấu “/” hay đường dẫn ở cuối. Mỗi địa chỉ bạn dùng app (VD bản thật trên Netlify và bản thử http://localhost:3000) phải thêm riêng. Mục Authorized redirect URIs để trống. Bấm Create.
http://localhost:3000
Sao chép Client ID có dạng 123456789012-abc…xyz.apps.googleusercontent.com (không phải Client secret) → dán vào ô Google OAuth Client ID trong Cài đặt → bấm Kết nối Google Drive → chọn tài khoản → Cho phép.
123456789012-abc…xyz.apps.googleusercontent.com
Bấm Kiểm tra trong Cài đặt. Nếu thấy “✓ Drive hoạt động” là xong: nút Lưu Drive sẽ lưu vào thư mục DocScan/<tên tài liệu>.
DocScan/<tên tài liệu>
Địa chỉ vừa thêm ở Bước 4 có thể cần 5 phút đến vài giờ mới có hiệu lực – nếu báo origin_mismatch ngay sau khi tạo, hãy chờ rồi thử lại.
Error 400: origin_mismatch
Error 403: access_denied
Error 401: invalid_client
npx serve .
http://localhost
index.html
Quyền riêng tư: với drive.file, app chỉ thấy và sửa các file do chính nó tạo, không đọc được file khác trong Drive. Có thể thu hồi quyền bất cứ lúc nào tại myaccount.google.com/connections.
Do this once, about 10 minutes, free. You create your own "key" (Client ID) that lets the app save files to your Drive. No server, and no secret key is stored in the app.
Sign in with the Gmail account you want to save files to → create a new project with any name (e.g. DocScan) → Create. In the next steps, make sure this project is selected in the top bar.
Open the Google Drive API page → click Enable (if you see Manage, it is already enabled).
Branding: fill in App name (e.g. DocScan), User support email, Developer contact → Save. Audience: choose External. Then choose one of:
Data Access → Add or remove scopes → find and tick .../auth/drive.file → Update → Save.
Clients → Create client → Application type: Web application → give it a name. Under Authorized JavaScript origins → Add URI → paste this app's exact address:
Only scheme + domain (+ port) – no trailing “/” or path. Add every address you use the app from (e.g. your Netlify site and http://localhost:3000 for testing). Leave Authorized redirect URIs empty. Click Create.
Copy the Client ID, which looks like 123456789012-abc…xyz.apps.googleusercontent.com (not the Client secret) → paste it into Google OAuth Client ID in Settings → tap Connect Google Drive → choose your account → Allow.
Tap Test in Settings. If you see “✓ Drive works”, you are done: Save to Drive will save into DocScan/<document name>.
DocScan/<document name>
The address added in Step 4 may take 5 minutes to a few hours to take effect – if you get origin_mismatch right after creating it, wait and try again.
Privacy: with drive.file, the app can only see and edit files it created itself – not the rest of your Drive. Revoke access any time at myaccount.google.com/connections.