Skip to content

🔩 Add outlines to preserved tagged PDFs and normalize document dates - #7

Merged
JFWooten4 merged 6 commits into
mainfrom
snails
Oct 18, 2026
Merged

JFWooten4 merged 6 commits into
mainfrom
snails

Conversation

@codex-pony

@codex-pony codex-pony Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

PDFs can retain selectable, tagged text yet have no document outline for section navigation. In the existing-text preservation path, use pdfminer layout extraction to recognize isolated, centered, title-like lines and create page-targeted H2/H3 bookmarks only when the PDF already has a structure tree and no outline. Promote existing /P elements to /H2 or /H3 where their marked-content text exactly matches a recognized heading, preserving page content streams, marked-content IDs (MCIDs), and nested /Span formatting. Recognition is heuristic and deliberately limited to conservative layouts.

The PDF Association's bookmark guidance distinguishes navigable outlines from the text printed on the page. Unlike the --retag text-structure reconstruction introduced in #4, this path adds navigation to existing tagged content without rebuilding its text stream.

Separately, normalize valid Date: YYYY-MM-DD tokens found in PDF Info /Keywords, XMP pdf:Keywords, or Dublin Core dc:subject. Remove those labeled tokens from keywords and add unique values to dc:date, preserving other keywords, previously recorded dc:date values, and the independent PDF /CreationDate. Unlabeled or invalid dates are left alone. Adobe's Dublin Core namespace definition identifies dc:date as a resource-lifecycle date and dc:subject as a keyword field; this targeted normalization complements the broader metadata crosswalk merged in #6.

Regression tests cover bookmark generation without changed page-content bytes, promotion of a mixed-style italic heading without losing inline spans, and date extraction while preserving ordinary keywords and the creation timestamp. These tests were added but not run in this drafting session. The branch is four commits ahead and three behind the current main; the newer tagging and metadata changes overlap these modules, so post-integration behavior is not yet verified.

JFWooten4 and others added 6 commits October 15, 2026 19:50
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Merge main's metadata-provenance, OCR, and reading-order changes into snails while preserving its tagged-PDF outlines and labeled document-date normalization. Keep existing Creator and Producer values, creation timestamps, unrelated keywords, structure trees, content bytes, and inline spans. Add regression coverage and a focused CI workflow for both behaviors.

Co-authored-by: John Wooten <noreply@wooten.link>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex Web <noreply@openai.com>
Compare Dublin Core language values as a set because recent pikepdf versions return a set for rdf:Bag properties. Preserve the exact expected en-US value while allowing the metadata and preserved-text regression jobs to complete.

Co-authored-by: Codex Web <noreply@openai.com>
@JFWooten4
JFWooten4 merged commit 7ea18b9 into main Oct 18, 2026
2 checks passed
@JFWooten4
JFWooten4 deleted the snails branch October 18, 2026 20:45
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