feat(extractor): adopt Detective-XH/pdf v0.6.0 Metadata API#65
Merged
Conversation
- bump github.com/Detective-XH/pdf v0.5.0 -> v0.6.0. Public API unchanged (OpenBytes/Page/Font/Value signatures identical), so no call-site changes. Automatic gains: broader CJK CMap coverage (GB-EUC/GBKp-EUC/ETenms-B5/ KSC-EUC/KSCms-UHC) and upstream hardening (inline-image crash, zero-length stream, multi-stream OOM, object-nesting depth) that strengthen the malformed-PDF panic guard in extractor.go. - extractPDF reads the Info dict via r.Info() (Title/Author/Subject/Keywords) instead of hand-walking Trailer -> Info. - BEHAVIOR CHANGE: pdf.creation_date is now a normalized RFC3339 UTC timestamp via info.CreationDate() (was the raw 'D:YYYYMMDD...' PDF string); empty on absent/unparseable date. pdf.go is the sole writer and no consumer parsed the old format, so this is display-only. - test: extend buildMinimalPDFEnc with an /Info dict param; add TestExtractPDF_CreationDateNormalized pinning +05'00' -> 04:30:00Z. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the PDF dependency to v0.6.0 and adopts its new Metadata API.
github.com/Detective-XH/pdfv0.5.0 → v0.6.0. Public API unchanged (OpenBytes/Page/Font/Valuesignatures identical) → no call-site changes.extractor.go.extractPDFreads the Info dict viar.Info()(Title/Author/Subject/Keywords) instead of hand-walkingTrailer → Info.pdf.creation_dateis now a normalized RFC3339 UTC timestamp viainfo.CreationDate()(was the rawD:YYYYMMDD…PDF string); empty on absent/unparseable date.pdf.gois the sole writer and no consumer parses the old format, so this is display-only.Tests
buildMinimalPDFEncwith an/Infodict param.TestExtractPDF_CreationDateNormalizedpinsD:20240115093000+05'00'→2024-01-15T04:30:00Z.go build ./...✅ ·go test -race ./...18/0 ✅ · gofmt -s / vet clean ✅Touchpoints
.docgraphmigration needed.🤖 Generated with Claude Code