mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 04:22:20 +00:00
M2.6: say why pruning reads a form's /Subtype only when direct
The sweep flags the read in Pruner::form, moved there by this change. A /Subtype given by reference reads as no form wherever the workspace tells forms from images; resolving it is a change across all of them, and the comment says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
This commit is contained in:
1 parent
431a647cd5
commit
a4130c9973
1 file changed
+3
@@ -222,6 +222,9 @@ impl Pruner<'_> {
|
||||
fn form(&mut self, xobjects: &Dict, name: &[u8], resources: &Dict, owner: Owner, depth: u8) {
|
||||
let Some(r) = xobjects.get(name).and_then(Object::as_ref) else { return };
|
||||
let Object::Stream(s) = &*self.doc.get(r) else { return };
|
||||
// A `/Subtype` given by reference reads as no form here, as wherever the workspace tells
|
||||
// forms from images (redaction, edit and Optimize among them): resolving it is a change
|
||||
// across all of them.
|
||||
if s.dict.name(b"Subtype") != Some(b"Form") {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user