9f97f3abbe
CI - Node Bindings / Build darwin-arm64 (push) Waiting to run
CI - Node Bindings / Build darwin-x64 (push) Waiting to run
CI - Node Bindings / Test win32-x64-msvc (push) Blocked by required conditions
CI - Node Bindings / Build linux-arm64-gnu (push) Waiting to run
CI - Node Bindings / Build linux-x64-gnu (push) Waiting to run
CI - Node Bindings / Build linux-x64-musl (push) Waiting to run
CI - Node Bindings / Build win32-arm64-msvc (push) Waiting to run
CI - Node Bindings / Build win32-x64-msvc (push) Waiting to run
CI - Node Bindings / Test darwin-arm64 (push) Blocked by required conditions
CI - Node Bindings / Test darwin-x64 (push) Blocked by required conditions
CI - Node Bindings / Test linux-x64-gnu (push) Blocked by required conditions
CI - Node Bindings / Test linux-x64-musl (push) Blocked by required conditions
CI - Node Bindings / Test win32-arm64-msvc (push) Blocked by required conditions
CI - Python Bindings / Build aarch64-pc-windows-msvc (push) Waiting to run
CI - Python Bindings / Build x86_64-pc-windows-msvc (push) Waiting to run
CI - Python Bindings / Build x86_64-apple-darwin (push) Waiting to run
CI - Python Bindings / Build aarch64-apple-darwin (push) Waiting to run
CI - Python Bindings / Build aarch64-unknown-linux-gnu (push) Waiting to run
CI - Python Bindings / Test x86_64-apple-darwin (push) Blocked by required conditions
CI - Python Bindings / Test aarch64-apple-darwin (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-unknown-linux-gnu (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-unknown-linux-musl (push) Blocked by required conditions
CI - Python Bindings / Test aarch64-pc-windows-msvc (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-pc-windows-msvc (push) Blocked by required conditions
CI / build-and-test (macos-26-intel) (push) Waiting to run
CI / build-and-test (macos-latest) (push) Waiting to run
CI / build-and-test (windows-11-arm) (push) Waiting to run
CI / build-and-test (windows-latest) (push) Waiting to run
CI - Python Bindings / sdist (push) Failing after 1s
CI - Python Bindings / Build x86_64-unknown-linux-musl (push) Failing after 1s
CI / fmt (push) Failing after 1s
E2E Output Validation / compare-outputs (push) Failing after 1s
Sync Docs to Developer Hub / sync-docs (push) Failing after 1s
CI - Python Bindings / Build x86_64-unknown-linux-gnu (push) Failing after 1s
CI - WASM Bindings / Build WASM (push) Failing after 0s
CI / clippy (push) Failing after 1s
CI / build-and-test (ubuntu-latest) (push) Failing after 0s
CI - WASM Bindings / Edge runtime PDF parse test (push) Has been skipped
CI - WASM Bindings / Browser PDF parse test (push) Has been skipped
E2E Output Validation / upload-dataset (push) Waiting to run
Deploy Demo to GitHub Pages / deploy (push) Failing after 1s
CI / build-docker-image (push) Failing after 3s
54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>LiteParse WASM Browser Test</title>
|
|
</head>
|
|
<body>
|
|
<div id="status">loading</div>
|
|
<div id="result" style="display:none"></div>
|
|
<div id="error" style="display:none"></div>
|
|
|
|
<script type="module">
|
|
const status = document.getElementById("status");
|
|
const resultEl = document.getElementById("result");
|
|
const errorEl = document.getElementById("error");
|
|
|
|
try {
|
|
status.textContent = "loading wasm";
|
|
const { default: init, LiteParse } = await import("/packages/wasm/pkg/liteparse_wasm.js");
|
|
await init();
|
|
|
|
status.textContent = "creating parser";
|
|
const parser = new LiteParse({ ocrEnabled: false, outputFormat: "text", quiet: true });
|
|
|
|
status.textContent = "fetching pdf";
|
|
const resp = await fetch("/demo/docs/apple-10k-2024.pdf");
|
|
if (!resp.ok) throw new Error(`Failed to fetch PDF: ${resp.status}`);
|
|
const bytes = new Uint8Array(await resp.arrayBuffer());
|
|
|
|
status.textContent = "parsing";
|
|
const result = await parser.parse(bytes);
|
|
|
|
const pageCount = result.pages.length;
|
|
const textLength = result.text.length;
|
|
const hasText = textLength > 100;
|
|
|
|
if (pageCount === 0) throw new Error("No pages parsed");
|
|
if (!hasText) throw new Error(`Text too short: ${textLength} chars`);
|
|
|
|
status.textContent = "done";
|
|
resultEl.style.display = "block";
|
|
resultEl.setAttribute("data-pages", pageCount);
|
|
resultEl.setAttribute("data-text-length", textLength);
|
|
resultEl.textContent = `OK: ${pageCount} pages, ${textLength} chars`;
|
|
} catch (err) {
|
|
status.textContent = "error";
|
|
errorEl.style.display = "block";
|
|
errorEl.textContent = err.message || String(err);
|
|
console.error(err);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|