Skip to content

Commit bdd01f1

Browse files
authored
Merge pull request #640 from embedpdf/fix/redaction-layout-shift
Collapse split page content into single stream
2 parents 0d85365 + 70306b1 commit bdd01f1

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@embedpdf/pdfium': patch
3+
---
4+
5+
Fix page layout shifting after editing PDFs whose `/Contents` is a split-stream array (e.g. after redaction).
6+
7+
PDF renders `/Contents` as one continuous program, so graphics state set in one stream carries into the next. The previous behaviour rewrote only the dirty streams while keeping the original split boundaries, which could corrupt the graphics-state handoff between streams and shift the visible layout. `CPDF_PageContentGenerator::GenerateContent` now collapses all active page objects into a single canonical content stream when the page has been edited, via `GenerateCanonicalPageStream` + `CPDF_PageContentManager::ReplaceWithSingleStream`. Form XObjects keep their existing single-stream behaviour.
2.36 KB
Binary file not shown.

0 commit comments

Comments
 (0)