Skip to content

Commit

Permalink
PdfPage.flatten(): add note regarding invalidation of handles
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Sep 19, 2024
1 parent ef0854e commit d54d041
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pypdfium2/_helpers/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ def flatten(self, flag=pdfium_c.FLAT_NORMALDISPLAY):
Flatten form fields and annotations into page contents.
Attention:
:meth:`~.PdfDocument.init_forms` must have been called on the parent pdf, before the page was retrieved, for this method to work.
In other words, :attr:`.PdfPage.formenv` must be non-null.
* :meth:`~.PdfDocument.init_forms` must have been called on the parent pdf, before the page was retrieved, for this method to work. In other words, :attr:`.PdfPage.formenv` must be non-null.
* Flattening may invalidate existing handles to the page, so you'll want to re-initialize them after flattening.
Parameters:
flag (int): PDFium flattening target (:attr:`FLAT_*`)
Expand Down

0 comments on commit d54d041

Please sign in to comment.