Repository navigation
Conversation
mtlcl410
force-pushed
the
feat/custom-document-properties
branch
from
October 15, 2026 16:23
2021be2 to
57a6a95
Compare
…anize.custom-properties) /Info entries beyond the ones the spec names are custom properties: organize lists them (custom_info) and set_info accepts any such name after Acrobat's checks (no standard name, no empty name, no spaces, delimiters, / or #, at most 127 bytes); inspection lists them too (DocInfo::custom); doc_info reports them under custom and doc_set_info sets or clears them. The Custom tab in Document Properties and the XMP mirror stay planned. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUNQSPVXx3dDBabRZHAnjz
mtlcl410
force-pushed
the
feat/custom-document-properties
branch
from
October 16, 2026 11:28
57a6a95 to
5df5688
Compare
This branch has not been deployed
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.
What this changes
Custom document properties (Acrobat's Document Properties ▸ Custom: name/value pairs kept in
/Infobeside the standard entries), through the engine and the tools. The dialog's Custom tab is a follow-up, after #2012 lands ondialogs.rs.pdfcraft-organize:custom_infolists every/Infoentry whose key the spec does not name (STANDARD_INFO_KEYS, table 349) and whose value is text, at most 256.check_custom_keyapplies the rules Acrobat applies to a custom name: not a standard name, not empty, at most 127 bytes (the name length every reader must accept, Annex C), and none of whitespace, the delimiters()<>[]{}/%or#, so the name reads the same everywhere.set_inforuns that check for any non-standard key, so a custom entry is set and cleared exactly as Title and Author are (and undone as one step, labelled "Change {key}" as before).pdfcraft-render:DocInfo::custom, the same list from inspection, so an opened file shows its custom entries at once.pdfcraft-engine:Document::custom_info, and the metadata refresh after an edit keepsinfo.customcurrent.pdfcraft-automation:doc_infolists them undercustom(name,value), anddoc_set_info's description says custom names are accepted and how they are checked.pdfcraft-cli infoadds acustom_propertiescount.parity/:organize.custom-propertiesbecomes partial with what is still missing (the Custom tab; mirroring into XMPpdfx:as Acrobat does).How you verified it
cargo fmt --checkcargo clippy -p pdfcraft-organize -p pdfcraft-render -p pdfcraft-engine -p pdfcraft-automation -p pdfcraft-cli -j 2 --all-targets -- -D warningscargo test -p pdfcraft-organize -j 2(120 passed),cargo test -p pdfcraft-render -j 2 --lib(272),cargo test -p pdfcraft-automation -j 2 --test automation(155)cargo xtask parity,cargo xtask layersTests, each shown failing with the listing disabled (
custom_inforeturning nothing; inspection taking no custom entry) and passing with it:organize::tests::custom_document_properties_are_listed_set_removed_and_their_names_checked: Title plus Project and Revision set; only the two custom ones are listed; clearing one and saving keeps the other; the refused names (empty,Title,ModDate, a space,/, a tab,#, parentheses, 128 bytes) and the accepted ones (Project,Révision,部門,key-2.0, 127 bytes);set_infowith a bad name changes nothing.inspect::tests::custom_document_properties_are_listed_apart_from_the_standard_ones: an/Infowith Title, Producer, Project, a numeric Revision,Dept (R&D),Trappedand a UTF-16Note: the three text custom entries are listed, the number and the standard entries are not.custom_document_properties_are_set_listed_and_cleared_through_the_tools:doc_set_infosets two custom entries anddoc_infolists them apart from Title; a name with a space and an empty name are refused; clearing one, saving and reopening lists the one left with its value.Never-crash
unwrap/expect/indexing outside tests; the custom list is capped at 256 entries; a name over 127 bytes is refused before it reaches the writerunsafeProvenance
Security
Parity and reach
organize.custom-propertiesupdated with evidence and what is still missing; toolsdoc_infoanddoc_set_infocover it headlessly🤖 Generated with Claude Code