Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8d6eb77
ENH: Preserve OCGs when merging PDFs
mTangtrongwanit Aug 18, 2026
7670598
MAINT: fix linting issues for OCG ENH
mTangtrongwanit Aug 18, 2026
b6bbda1
TST: Uploading OCG test files
mTangtrongwanit Aug 19, 2026
d551f9e
TST: targeting uploaded OCG test files
mTangtrongwanit Aug 19, 2026
553b22b
MAINT: implement docstrings for for OCG functions
mTangtrongwanit Aug 25, 2026
7013b39
MAINT: Refactor OCG functions out from writer
mTangtrongwanit Sep 2, 2026
7c2a14f
TST: update target OCG test files
mTangtrongwanit Sep 2, 2026
7bb0905
Merge branch 'main' into appendOCGs
mTangtrongwanit Sep 10, 2026
6d44c90
TST: update styling and test targets sample-file folder OCG test pdf
mTangtrongwanit Sep 10, 2026
21d9e32
TST: Updating the submodule commit
mTangtrongwanit Sep 11, 2026
70642b2
STY: Add some minor refactoring
mTangtrongwanit Sep 21, 2026
4e71455
STY: Add more suggested changes pt 2
mTangtrongwanit Sep 23, 2026
52c7d4e
STY: Add more suggested changes pt 3
mTangtrongwanit Sep 23, 2026
ba9cfb6
STY: Add suggested changes and refactors pt 4
mTangtrongwanit Sep 24, 2026
1264cf7
TST: Refactor tests and output to tmp_path
mTangtrongwanit Sep 24, 2026
8521968
STY: Refactored "_preserve_oc_properties" and other suggestions
mTangtrongwanit Sep 24, 2026
3b32879
TST: update ocg comment
mTangtrongwanit Oct 6, 2026
fced5d3
TST: update PDF in resources folder to newer file with OCG structures
mTangtrongwanit Oct 8, 2026
5fcd16b
Merge branch 'main' into appendOCGs
mTangtrongwanit Oct 9, 2026
c68e05c
TST: update OCG tests to resolve coverage issues
mTangtrongwanit Oct 13, 2026
714f015
Merge branch 'main' into appendOCGs
mTangtrongwanit Oct 13, 2026
b58343d
Merge branch 'main' into appendOCGs
mTangtrongwanit Oct 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pypdf/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
is_null_or_none,
)
from .generic._appearance_stream import TextStreamAppearance
from .generic._optional_content_groups import _preserve_oc_properties
from .pagerange import PageRange, PageRangeSpec
from .types import (
AnnotationSubtype,
Expand Down Expand Up @@ -2894,6 +2895,10 @@ def merge(
NameObject("/Fields")
] = arr

# Preserve OCG Code
# Feed in reader with PDF pages to append
_preserve_oc_properties(self, reader)

if "/B" not in excluded_fields:
self.add_filtered_articles("", srcpages, reader)

Expand Down
Loading
Loading