Skip to content

docs + upstream: positioning vignettes, gap tracker, 3 patches drafted#35

Merged
billdenney merged 4 commits into
mainfrom
claude/0.1.0-final-polish
May 21, 2026
Merged

docs + upstream: positioning vignettes, gap tracker, 3 patches drafted#35
billdenney merged 4 commits into
mainfrom
claude/0.1.0-final-polish

Conversation

@billdenney
Copy link
Copy Markdown
Member

Post-v0.1.0 polish stack. Stacks on main; no R/, src/, or NAMESPACE
changes — entirely under dev/, vignettes/, and README*. Safe to
review by commit.

Summary

Seven commits. The first four are positioning + planning docs; the
last three are concrete upstream-PDFium patches drafted from the
tracker.

  • b926cc4 — Comparison vignette + README writer-surface
    mention. vignettes/comparison.Rmd positions pdfium against
    pdftools/qpdf/magick/tabulapdf/staplr/xmpdf.
    README.Rmd/README.md updated to acknowledge both halves of
    the package.
  • 6faf014dev/v0.1.0-api-gap-audit.md. Coverage snapshot
    at release (~64%) grouped into v0.2.0-priority buckets.
  • 3695235dev/upstream-api-gaps.md. Consolidated tracking
    doc for a single upstream-PDFium request: 12 proposed CLs, each
    with C signature, rationale, internal-implementation pointer,
    R-side consumer, self-contained flag. Stable structure for
    incremental append.
  • cd15137 — CL 1 drafted: pdfium-FPDF_SetMetaText.patch
    (246 lines, Change-Id Ia3e57b3d...). Symmetric writer for
    FPDF_GetMetaText. Implementation mirrors
    FPDFCatalog_SetLanguage. Three embedder tests including
    multi-byte-Unicode round-trip + new-document path + save
    persistence.
  • f1a28e3 — CL 6 drafted:
    pdfium-FPDFAttachment_SetSubtype.patch (260 lines, Change-Id
    I9c9d45ef...). Symmetric writer for
    FPDFAttachment_GetSubtype. Closes the gap the Phase 8 R-side
    pdf_attachment_set_dict_value() docstring calls out. Adds a
    CPDF_FileSpec::GetMutableFileStream() core helper modeled on
    the existing GetMutableParamsDict. Three embedder tests
    including pre-/post-SetFile contract + save persistence.
  • ba1c419 — CL 7 drafted:
    pdfium-FPDFAnnot_SetNumberValue.patch (195 lines, Change-Id
    I7bf21fa3...). Symmetric writer for FPDFAnnot_GetNumberValue.
    14-line implementation, exact mirror of FPDFAnnot_SetStringValue.
    Unblocks /CA opacity, /IT rotation, /BS/W border width,
    arbitrary numeric custom keys. One embedder test covering
    invalid-args, overwrite, fresh-key, sign/zero/fractional
    round-trip, and type-replacement.

Upstream tracker status after this PR

CL Status Patch
Bezier control points uploaded as CL 147810 (existing)
SetFontSize drafted (existing)
AppendOption drafted (existing)
CL 1 SetMetaText drafted this PR
CL 6 SetSubtype drafted this PR
CL 7 SetNumberValue drafted this PR
CL 2-5, 8-12 proposed remaining in tracker

Six patches now in flight or drafted; nine CL slots remaining.
Tracker structured for incremental append as more gaps surface
during ongoing work.

Test plan

  • CI matrix green (only pre-commit and read-only checks
    should fire; nothing under R/ or src/)
  • pkgdown picks up vignettes/comparison.Rmd automatically
  • Each of the three new patches applies cleanly to upstream
    PDFium HEAD via git am
  • Spot-check the new tracker entries in
    dev/upstream-api-gaps.md for typos

🤖 Generated with Claude Code

billdenney and others added 4 commits May 21, 2026 12:56
Per the v0.1.0 close-out review, the user wants a single coherent
upstream request rather than a stream of one-off CLs. This is the
tracking document that batched request will draw from.

Covers 12 proposed self-contained CLs:

* CL 1 — FPDF_SetMetaText doc Info writer
* CL 2 — Bookmark / outline authoring cluster (New / SetTitle /
         SetDest / Delete)
* CL 3 — Action and destination introspection completers
         (SetGoToAction / SetLaunchAction / SetNamedAction)
* CL 4 — FPDFAnnot_SetFormFieldValue / SetFormFieldExportValue
* CL 5 — Encryption / password-protect on write
         (FPDF_SetEncryption / RemoveEncryption)
* CL 6 — Attachment Subtype writer (file-stream, distinct from
         existing Params-dict SetStringValue)
* CL 7 — Annotation Number / numeric-key writers
* CL 8 — Annotation geometry writers (vertices, line, ink)
* CL 9 — FPDFFormObj_AppendObject (form-XObject child writer)
* CL 10 — Color-space introspection on page objects
* CL 11 — Annotation SetFont / SetFontColor for FreeText
* CL 12 — Path-based clip-path constructor

Each CL entry includes:
  - The exact C signature(s).
  - One-paragraph rationale tied to a concrete embedder workflow.
  - A pointer to the internal CPDF_* method that already implements
    the underlying logic (e.g. `CPDF_Document::GetInfo()` returns a
    mutable dictionary; SetMetaText is a `SetNewFor<CPDF_String>`
    mirror).
  - The R-side `pdf_*()` consumer that would gain functionality.
  - Self-contained-or-pairs-with flag.

Also includes:
  - The three in-flight upstream patches (Bezier, SetFontSize,
    AppendOption) — listed under "don't re-request" to avoid
    duplication in the consolidated mailing-list ask.
  - A "lower-priority observed gaps" section for completeness.
  - A cross-cutting notes section listing the precedent patterns
    the proposed CLs reuse (FPDFCatalog_SetLanguage, inheritance
    copy-down trick, etc.).

Structured for incremental append: stable section headers, ordered
CL list. New entries can be added without restructuring as more
gaps surface during ongoing v0.2.0 work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Promotes the highest-priority entry from dev/upstream-api-gaps.md
from "proposed" to "drafted": adds the symmetric writer for
FPDF_GetMetaText.

The patch is at dev/upstream-patches/pdfium-FPDF_SetMetaText.patch,
generated by git format-patch against upstream HEAD e30fc3988. 246
lines covering:

* public/fpdf_doc.h — declaration with full doc comment immediately
  after the existing FPDF_GetMetaText.
* fpdfsdk/fpdf_doc.cpp — implementation mirroring
  FPDFCatalog_SetLanguage line-for-line: get the mutable
  CPDF_Document::GetInfo() dictionary, write a CPDF_String via
  SetNewFor with the WideStringFromFPDFWideString path. Using the
  WideStringView overload (rather than FPDFAttachment_SetStringValue's
  ByteString path) means multi-byte Unicode round-trips losslessly.
* fpdfsdk/fpdf_view_c_api_test.c — CHK entry so api_check.py passes
  presubmit.
* fpdfsdk/fpdf_doc_embeddertest.cpp — three new FPDFDocEmbedderTest
  cases (SetMetaText, SetMetaTextOnNewDocument,
  SetMetaTextPersistsAcrossSave) verifying invalid-arg rejection,
  basic set + read-back, multi-byte Unicode round-trip, overwrite,
  empty-string legitimate value, the FPDF_CreateNewDocument() path,
  and FPDF_SaveAsCopy + OpenSavedDocument persistence.

Change-Id Ia3e57b3dcdd0466c166728cd82fed8d9bfc9c06f. Ready to
upload via `git cl upload --bypass-hooks` from a CLA-signed
machine per dev/upstream-patches/README.md.

The tracker (dev/upstream-api-gaps.md) and patches index
(dev/upstream-patches/README.md) are both updated to reflect the
new status — CL 1 now reads "drafted" rather than appearing only
in the "proposed CLs" list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drafts CL 6 from dev/upstream-api-gaps.md: adds the symmetric writer
for FPDFAttachment_GetSubtype, which currently reads the embedded
file stream's /Subtype (the MIME type per ISO 32000-2 §7.11.4) but
has no public counterpart for writing it.

The patch is at
dev/upstream-patches/pdfium-FPDFAttachment_SetSubtype.patch, 260
lines against upstream HEAD e30fc3988. Closes one of the two
upstream gaps the R-side pdf_attachment_set_dict_value() docstring
calls out — embedders building attachments programmatically now
have a public way to declare the MIME type, rather than re-parsing
and patching the saved PDF out of band.

Implementation mirrors FPDFAttachment_GetSubtype exactly (CPDF_FileSpec
+ file-stream lookup), writes /Subtype as a CPDF_Name on the file
stream's dictionary, and adds a CPDF_FileSpec::GetMutableFileStream()
core helper modeled directly after the existing GetMutableParamsDict
counterpart. Three embedder tests cover invalid-arg rejection,
overwrite, fresh-attachment pre-/post-SetFile contract, and
FPDF_SaveAsCopy + OpenSavedDocument persistence.

Change-Id I9c9d45efc4986252faa577e70d993103e777cdb3. Ready to
upload via `git cl upload --bypass-hooks` from a CLA-signed
machine per dev/upstream-patches/README.md.

Tracker (dev/upstream-api-gaps.md) and patches index
(dev/upstream-patches/README.md) updated to flag CL 6 as "drafted".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drafts CL 7 from dev/upstream-api-gaps.md — the smallest contained
entry in the tracker. Adds the symmetric writer for
FPDFAnnot_GetNumberValue, which currently reads a float from an
annotation's dictionary by key but has no writer counterpart.

The patch is at
dev/upstream-patches/pdfium-FPDFAnnot_SetNumberValue.patch, 195
lines against upstream HEAD e30fc3988. 14-line implementation,
mirrors FPDFAnnot_SetStringValue exactly. Unblocks writing common
numeric annotation fields: /CA constant opacity, /IT free-text
rotation, /BS/W border width, or arbitrary custom-namespace floats.

One embedder test (SetNumberValue) covers invalid-arg rejection,
overwrite of an existing numeric key with GetValueType assertion,
setting a previously-absent key, negative/zero/fractional
round-trip, and type-replacement of a non-number key.

Change-Id I7bf21fa3f70763f69fdcabd54baa2f0771af80cf. Ready to
upload via `git cl upload --bypass-hooks` per
dev/upstream-patches/README.md.

Tracker (dev/upstream-api-gaps.md) and patches index
(dev/upstream-patches/README.md) updated to flag CL 7 as "drafted".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@billdenney billdenney merged commit 58debe2 into main May 21, 2026
11 checks passed
@billdenney billdenney deleted the claude/0.1.0-final-polish branch May 21, 2026 14:32
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