Skip to content

Add PDF and Word processing to the browser demo - #15

Merged
OKAN-SOFTWARE merged 1 commit into
mainfrom
feature/browser-pdf-word
Nov 6, 2026
Merged

OKAN-SOFTWARE merged 1 commit into
mainfrom
feature/browser-pdf-word

Conversation

@OKAN-SOFTWARE

Copy link
Copy Markdown
Owner

Enable browser-only PDF and Word (.docx) import/export on the existing portfolio demo while preserving the Java application's source and server endpoints.

The browser adapter extracts PDF text with PDF.js and Word main-document XML via bounded JSZip streaming, and generates paginated PDF-LIB/Word exports. Keep 5 MB/50-page/50,000-character import limits, reject unsupported inputs, preserve Unicode in Word, explain unsupported PDF glyphs, and export every FAQ regardless of filters. Library versions are pinned and lazy-loaded from jsDelivr; document content is not uploaded. The existing revision guards discard late import/export results after edits or clearing.

Restore the PDF/Word choices in the generated site, add document-library disclosure/attribution, and update README and guides.

Validation: 60 JavaScript tests pass locally; static build, syntax checks and diff checks pass. Real PDF and DOCX imports and export completion verified through browser UI. Real exported files were also generated with the adapter against the actual libraries, rendered, and visually inspected across three pages each. The browser download event was not captured by the preview automation, so binary-file integrity/layout was checked separately with the same exporter. CI runs Java/JavaScript verification and the demo build. Public-domain verification follows website deployment.

@OKAN-SOFTWARE
OKAN-SOFTWARE merged commit 03b3ee7 into main Nov 6, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6dfe0b68c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web-demo/documents.js
if (typeof item.str !== 'string') continue;
const y = item.transform?.[5];
if (line && lastY !== null && Number.isFinite(y) && Math.abs(y - lastY) > 3) { pageText += line.trim() + '\n'; line = ''; }
line += (line && !line.endsWith(' ') ? ' ' : '') + item.str;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve spacing between adjacent PDF text runs

When a PDF splits a word or punctuation across text items, such as at a font change, this unconditionally inserts a space even when the items are contiguous on the page. For example, adjacent pass and word items become pass word; separate Q and : items become Q :, which the browser draft engine no longer recognizes as a question prefix. This silently changes imported source content and can prevent FAQ extraction. Preserve explicit whitespace and use item positions and widths to distinguish actual word gaps from contiguous text runs.

Useful? React with 👍 / 👎.

@OKAN-SOFTWARE
OKAN-SOFTWARE deleted the feature/browser-pdf-word branch November 6, 2026 20:44
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T20:44:31.804837Z 6dfe0b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant