132 lines
4.9 KiB
HTML
132 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
SPDX-FileCopyrightText: 2026 James R. Barlow
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
-->
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="color-scheme" content="light dark">
|
|
<title>OCRmyPDF</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🖹</text></svg>">
|
|
</head>
|
|
<body>
|
|
<header class="topbar">
|
|
<h1>OCRmyPDF</h1>
|
|
<p class="tagline">Add a searchable text layer to scanned PDFs and images.</p>
|
|
</header>
|
|
|
|
<main>
|
|
<!-- ---------------- Upload view ---------------- -->
|
|
<section id="upload-view">
|
|
<div id="dropzone" class="dropzone" tabindex="0" role="button"
|
|
aria-label="Choose files or drop them here">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true" class="dropzone-icon">
|
|
<path d="M12 16V4m0 0L7.5 8.5M12 4l4.5 4.5M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"/>
|
|
</svg>
|
|
<p class="dropzone-title">Drop files here or click to browse</p>
|
|
<p class="dropzone-hint" id="dropzone-hint">PDF and image files</p>
|
|
<input type="file" id="file-input" multiple hidden>
|
|
</div>
|
|
|
|
<div id="queue-wrap" hidden>
|
|
<div class="queue-head">
|
|
<h2>Selected files <span id="queue-count" class="badge">0</span></h2>
|
|
<button type="button" id="clear-queue" class="link-button">Clear all</button>
|
|
</div>
|
|
<ul id="queue" class="file-list"></ul>
|
|
</div>
|
|
|
|
<form id="options-form" class="options">
|
|
<h2>Options</h2>
|
|
|
|
<div class="field">
|
|
<span class="label">Languages</span>
|
|
<div id="language-list" class="checkbox-grid"></div>
|
|
<p class="help">Pick every language that appears in your documents.</p>
|
|
</div>
|
|
|
|
<div class="field-row">
|
|
<label class="field">
|
|
<span class="label">Pages that already have text</span>
|
|
<select id="mode">
|
|
<option value="skip-text">Skip them (recommended)</option>
|
|
<option value="redo-ocr">Redo the existing OCR</option>
|
|
<option value="force-ocr">Rasterize and force OCR</option>
|
|
<option value="normal">Stop with an error</option>
|
|
</select>
|
|
</label>
|
|
|
|
<label class="field">
|
|
<span class="label">Output format</span>
|
|
<select id="output-type">
|
|
<option value="pdfa">PDF/A (archival, recommended)</option>
|
|
<option value="pdf">Standard PDF</option>
|
|
<option value="pdfa-1">PDF/A-1</option>
|
|
<option value="pdfa-2">PDF/A-2</option>
|
|
<option value="pdfa-3">PDF/A-3</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
|
|
<details class="advanced">
|
|
<summary>More options</summary>
|
|
<div class="field-row">
|
|
<label class="field">
|
|
<span class="label">Optimization</span>
|
|
<select id="optimize">
|
|
<option value="0">None</option>
|
|
<option value="1" selected>Safe (recommended)</option>
|
|
<option value="2">Lossy images</option>
|
|
<option value="3">Aggressive</option>
|
|
</select>
|
|
</label>
|
|
<label class="field">
|
|
<span class="label">Image DPI</span>
|
|
<input type="number" id="image-dpi" value="300" min="1" max="5000" step="10">
|
|
<span class="help">Used only for image inputs without DPI metadata.</span>
|
|
</label>
|
|
</div>
|
|
<div class="checkbox-grid">
|
|
<label class="check"><input type="checkbox" id="deskew"> Straighten crooked scans</label>
|
|
<label class="check"><input type="checkbox" id="clean"> Clean up before OCR</label>
|
|
<label class="check"><input type="checkbox" id="rotate-pages"> Auto-rotate pages</label>
|
|
</div>
|
|
</details>
|
|
|
|
<div class="actions">
|
|
<button type="submit" id="run" class="primary" disabled>Run OCR</button>
|
|
<span id="upload-status" class="upload-status" aria-live="polite"></span>
|
|
</div>
|
|
<div class="progress" id="upload-progress" hidden>
|
|
<div class="progress-bar" id="upload-progress-bar"></div>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
|
|
<!-- ---------------- Results view ---------------- -->
|
|
<section id="results-view" hidden>
|
|
<div class="queue-head">
|
|
<h2>Results <span id="results-progress" class="badge">0 / 0</span></h2>
|
|
<div class="result-actions">
|
|
<button type="button" id="download-all" class="primary" disabled>Download all (.zip)</button>
|
|
<button type="button" id="start-over" class="secondary">Start over</button>
|
|
</div>
|
|
</div>
|
|
<p class="help" id="retention-note"></p>
|
|
<ul id="results" class="file-list"></ul>
|
|
</section>
|
|
|
|
<div id="error" class="error" hidden role="alert"></div>
|
|
</main>
|
|
|
|
<footer>
|
|
<span>OCRmyPDF web interface <span id="version"></span></span>
|
|
</footer>
|
|
|
|
<script src="/app.js"></script>
|
|
</body>
|
|
</html>
|