Download index.html from PDFKing/README: direct link, hf CLI and curl.
- Browser
- Download file 9.33 kB
-
https://huggingface.co/spaces/PDFKing/README/resolve/main/index.html
- Command line
-
hf download hf://spaces/PDFKing/README/index.html
-
curl -L -o index.html https://huggingface.co/spaces/PDFKing/README/resolve/main/index.html
9.33 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>PDFKing - PDF Document Analyzer</title> | |
| <meta | |
| name="description" | |
| content="PDFKing browser-based PDF document analyzer. Inspect PDF files locally and view basic document information." | |
| > | |
| <style> | |
| * { | |
| box-sizing: border-box; | |
| } | |
| body { | |
| margin: 0; | |
| min-height: 100vh; | |
| font-family: | |
| Inter, | |
| -apple-system, | |
| BlinkMacSystemFont, | |
| "Segoe UI", | |
| Arial, | |
| sans-serif; | |
| background: | |
| radial-gradient( | |
| circle at top right, | |
| rgba(37, 99, 235, 0.10), | |
| transparent 35% | |
| ), | |
| #f6f8fc; | |
| color: #172033; | |
| } | |
| .page { | |
| width: min(1000px, calc(100% - 32px)); | |
| margin: 0 auto; | |
| padding: 50px 0 60px; | |
| } | |
| .header { | |
| text-align: center; | |
| margin-bottom: 34px; | |
| } | |
| .logo { | |
| width: 64px; | |
| height: 64px; | |
| margin: 0 auto 18px; | |
| display: grid; | |
| place-items: center; | |
| border-radius: 18px; | |
| background: linear-gradient(135deg, #2563eb, #4f46e5); | |
| color: white; | |
| font-weight: 800; | |
| font-size: 15px; | |
| box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25); | |
| } | |
| .header h1 { | |
| margin: 0; | |
| font-size: clamp(30px, 5vw, 46px); | |
| letter-spacing: -1.5px; | |
| } | |
| .header p { | |
| max-width: 650px; | |
| margin: 12px auto 0; | |
| color: #697386; | |
| font-size: 17px; | |
| line-height: 1.6; | |
| } | |
| .card { | |
| background: white; | |
| border: 1px solid #e5e9f2; | |
| border-radius: 24px; | |
| padding: 28px; | |
| box-shadow: 0 18px 50px rgba(20, 30, 50, 0.08); | |
| } | |
| .drop-zone { | |
| border: 2px dashed #cbd5e1; | |
| border-radius: 20px; | |
| padding: 60px 25px; | |
| text-align: center; | |
| background: #fbfcff; | |
| transition: 0.2s ease; | |
| } | |
| .drop-zone.dragover { | |
| border-color: #2563eb; | |
| background: #eff6ff; | |
| transform: translateY(-2px); | |
| } | |
| .upload-icon { | |
| width: 64px; | |
| height: 64px; | |
| margin: 0 auto 18px; | |
| border-radius: 50%; | |
| display: grid; | |
| place-items: center; | |
| background: #eff6ff; | |
| color: #2563eb; | |
| font-size: 28px; | |
| } | |
| .drop-zone h2 { | |
| margin: 0; | |
| font-size: 24px; | |
| } | |
| .drop-zone p { | |
| margin: 10px 0 22px; | |
| color: #707b8d; | |
| } | |
| .button { | |
| display: inline-flex; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 13px 22px; | |
| border-radius: 11px; | |
| background: #2563eb; | |
| color: white; | |
| font-weight: 700; | |
| cursor: pointer; | |
| border: 0; | |
| transition: 0.2s ease; | |
| } | |
| .button:hover { | |
| background: #1d4ed8; | |
| transform: translateY(-1px); | |
| } | |
| .hint { | |
| display: block; | |
| margin-top: 14px; | |
| color: #8a94a6; | |
| font-size: 13px; | |
| } | |
| .result { | |
| display: none; | |
| margin-top: 24px; | |
| } | |
| .result.show { | |
| display: block; | |
| } | |
| .result-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| gap: 15px; | |
| margin-bottom: 14px; | |
| } | |
| .result-header h3 { | |
| margin: 0; | |
| font-size: 19px; | |
| } | |
| .status { | |
| padding: 7px 11px; | |
| border-radius: 999px; | |
| background: #dcfce7; | |
| color: #15803d; | |
| font-size: 13px; | |
| font-weight: 700; | |
| } | |
| .info-grid { | |
| display: grid; | |
| grid-template-columns: repeat(2, 1fr); | |
| gap: 12px; | |
| } | |
| .info { | |
| padding: 17px; | |
| border-radius: 14px; | |
| background: #f8fafc; | |
| border: 1px solid #edf0f5; | |
| } | |
| .info span { | |
| display: block; | |
| color: #7b8494; | |
| font-size: 12px; | |
| margin-bottom: 6px; | |
| } | |
| .info strong { | |
| font-size: 15px; | |
| word-break: break-word; | |
| } | |
| .footer { | |
| text-align: center; | |
| margin-top: 28px; | |
| color: #7b8494; | |
| font-size: 14px; | |
| } | |
| .footer a { | |
| color: #2563eb; | |
| text-decoration: none; | |
| font-weight: 700; | |
| } | |
| @media (max-width: 650px) { | |
| .page { | |
| padding-top: 30px; | |
| } | |
| .card { | |
| padding: 16px; | |
| } | |
| .drop-zone { | |
| padding: 45px 18px; | |
| } | |
| .info-grid { | |
| grid-template-columns: 1fr; | |
| } | |
| .result-header { | |
| align-items: flex-start; | |
| flex-direction: column; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <main class="page"> | |
| <header class="header"> | |
| <div class="logo">PDF</div> | |
| <h1>PDF Document Analyzer</h1> | |
| <p> | |
| Inspect a PDF file directly in your browser and view | |
| basic document information without uploading it to a server. | |
| </p> | |
| </header> | |
| <section class="card"> | |
| <div class="drop-zone" id="dropZone"> | |
| <div class="upload-icon">β</div> | |
| <h2>Drop your PDF here</h2> | |
| <p> | |
| or choose a PDF file from your device | |
| </p> | |
| <label class="button"> | |
| Choose PDF | |
| <input | |
| id="fileInput" | |
| type="file" | |
| accept=".pdf,application/pdf" | |
| hidden | |
| > | |
| </label> | |
| <small class="hint"> | |
| Your file is inspected locally in this demo. | |
| </small> | |
| </div> | |
| <div class="result" id="result"> | |
| <div class="result-header"> | |
| <h3>Document Information</h3> | |
| <span class="status"> | |
| PDF detected | |
| </span> | |
| </div> | |
| <div class="info-grid"> | |
| <div class="info"> | |
| <span>File name</span> | |
| <strong id="fileName">β</strong> | |
| </div> | |
| <div class="info"> | |
| <span>File size</span> | |
| <strong id="fileSize">β</strong> | |
| </div> | |
| <div class="info"> | |
| <span>File type</span> | |
| <strong id="fileType">β</strong> | |
| </div> | |
| <div class="info"> | |
| <span>PDF signature</span> | |
| <strong id="fileSignature">β</strong> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <footer class="footer"> | |
| PDFKing β Free PDF tools for everyday document workflows. | |
| <br> | |
| <a | |
| href="https://pdfking.app/" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| > | |
| Visit PDFKing | |
| </a> | |
| </footer> | |
| </main> | |
| <script> | |
| const fileInput = | |
| document.getElementById("fileInput"); | |
| const dropZone = | |
| document.getElementById("dropZone"); | |
| const result = | |
| document.getElementById("result"); | |
| const fileName = | |
| document.getElementById("fileName"); | |
| const fileSize = | |
| document.getElementById("fileSize"); | |
| const fileType = | |
| document.getElementById("fileType"); | |
| const fileSignature = | |
| document.getElementById("fileSignature"); | |
| fileInput.addEventListener( | |
| "change", | |
| () => { | |
| if (fileInput.files.length) { | |
| analyzePDF(fileInput.files[0]); | |
| } | |
| } | |
| ); | |
| ["dragenter", "dragover"].forEach( | |
| eventName => { | |
| dropZone.addEventListener( | |
| eventName, | |
| event => { | |
| event.preventDefault(); | |
| dropZone.classList.add("dragover"); | |
| } | |
| ); | |
| } | |
| ); | |
| ["dragleave", "drop"].forEach( | |
| eventName => { | |
| dropZone.addEventListener( | |
| eventName, | |
| event => { | |
| event.preventDefault(); | |
| dropZone.classList.remove("dragover"); | |
| } | |
| ); | |
| } | |
| ); | |
| dropZone.addEventListener( | |
| "drop", | |
| event => { | |
| const file = | |
| event.dataTransfer.files[0]; | |
| if (file) { | |
| analyzePDF(file); | |
| } | |
| } | |
| ); | |
| async function analyzePDF(file) { | |
| const header = | |
| await readHeader(file); | |
| const isPDF = | |
| header.startsWith("%PDF-"); | |
| if (!isPDF) { | |
| alert( | |
| "The selected file does not appear to be a valid PDF." | |
| ); | |
| return; | |
| } | |
| fileName.textContent = | |
| file.name; | |
| fileSize.textContent = | |
| formatBytes(file.size); | |
| fileType.textContent = | |
| file.type || "application/pdf"; | |
| fileSignature.textContent = | |
| header; | |
| result.classList.add("show"); | |
| } | |
| function readHeader(file) { | |
| return new Promise(resolve => { | |
| const reader = | |
| new FileReader(); | |
| reader.onload = | |
| () => { | |
| const bytes = | |
| new Uint8Array( | |
| reader.result | |
| ); | |
| const header = | |
| new TextDecoder().decode(bytes); | |
| resolve(header); | |
| }; | |
| reader.readAsArrayBuffer( | |
| file.slice(0, 8) | |
| ); | |
| }); | |
| } | |
| function formatBytes(bytes) { | |
| if (bytes === 0) { | |
| return "0 Bytes"; | |
| } | |
| const units = | |
| [ | |
| "Bytes", | |
| "KB", | |
| "MB", | |
| "GB" | |
| ]; | |
| const index = | |
| Math.floor( | |
| Math.log(bytes) / | |
| Math.log(1024) | |
| ); | |
| return ( | |
| (bytes / | |
| Math.pow(1024, index) | |
| ).toFixed(2) | |
| + " " | |
| + units[index] | |
| ); | |
| } | |
| </script> | |
| </body> | |
| </html> |