docs + upstream: positioning vignettes, gap tracker, 3 patches drafted#35
Merged
Conversation
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>
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.
Post-v0.1.0 polish stack. Stacks on main; no R/, src/, or NAMESPACE
changes — entirely under
dev/,vignettes/, andREADME*. Safe toreview 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-surfacemention.
vignettes/comparison.Rmdpositionspdfiumagainstpdftools/qpdf/magick/tabulapdf/staplr/xmpdf.README.Rmd/README.mdupdated to acknowledge both halves ofthe package.
6faf014—dev/v0.1.0-api-gap-audit.md. Coverage snapshotat release (~64%) grouped into v0.2.0-priority buckets.
3695235—dev/upstream-api-gaps.md. Consolidated trackingdoc 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 forFPDF_GetMetaText. Implementation mirrorsFPDFCatalog_SetLanguage. Three embedder tests includingmulti-byte-Unicode round-trip + new-document path + save
persistence.
f1a28e3— CL 6 drafted:pdfium-FPDFAttachment_SetSubtype.patch(260 lines, Change-IdI9c9d45ef...). Symmetric writer forFPDFAttachment_GetSubtype. Closes the gap the Phase 8 R-sidepdf_attachment_set_dict_value()docstring calls out. Adds aCPDF_FileSpec::GetMutableFileStream()core helper modeled onthe existing
GetMutableParamsDict. Three embedder testsincluding pre-/post-
SetFilecontract + save persistence.ba1c419— CL 7 drafted:pdfium-FPDFAnnot_SetNumberValue.patch(195 lines, Change-IdI7bf21fa3...). Symmetric writer forFPDFAnnot_GetNumberValue.14-line implementation, exact mirror of
FPDFAnnot_SetStringValue.Unblocks
/CAopacity,/ITrotation,/BS/Wborder 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
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
pre-commitand read-only checksshould fire; nothing under
R/orsrc/)vignettes/comparison.RmdautomaticallyPDFium HEAD via
git amdev/upstream-api-gaps.mdfor typos🤖 Generated with Claude Code