Skip to content

Commit

Permalink
Add documentation for public attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Aug 30, 2022
1 parent 5dec9ba commit 1cef257
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/pypdfium2/_helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class PdfDocument:
* Looping over a document will yield its pages from beginning to end.
* Pages may be loaded using list index access.
* The ``del`` keyword and list index access may be used to delete pages.
Note:
The :attr:`.raw` attribute stores the underlying :class:`FPDF_DOCUMENT` object.
"""

def __init__(
Expand Down Expand Up @@ -506,7 +509,12 @@ def __init__(self, font_path):


class PdfFont:
""" PDF font data helper class. """
"""
PDF font data helper class.
Note:
The :attr:`.raw` attribute stores the underlying :class:`FPDF_FONT` object.
"""

def __init__(self, pdf_font, font_data):
self.raw = pdf_font
Expand Down
15 changes: 13 additions & 2 deletions src/pypdfium2/_helpers/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@


class PdfPage:
""" Page helper class. """
"""
Page helper class.
Note:
* The :attr:`.raw` attribute stores the underlying :class:`FPDF_PAGE` object.
* The :attr:`.pdf` attribute stores the :class:`.PdfDocument` object this page belongs to.
"""

def __init__(self, page, pdf):
self.raw = page
Expand Down Expand Up @@ -518,7 +524,12 @@ def convert(self, rev_byteorder):


class PdfPageObject:
""" Page object helper class. """
"""
Page object helper class.
Note:
The :attr:`.raw` attribute stores the underlying :class:`FPDF_PAGEOBJECT`.
"""

def __init__(self, pageobj):
self.raw = pageobj
Expand Down
16 changes: 14 additions & 2 deletions src/pypdfium2/_helpers/textpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@


class PdfTextPage:
""" Text extraction helper class. """
"""
Text extraction helper class.
Note:
* The :attr:`.raw` attribute stores the underlying :class:`FPDF_TEXTPAGE` object.
* The :attr:`.page` attribute stores the :class:`.PdfPage` this text page belongs to.
"""

def __init__(self, textpage, page):
self.raw = textpage
Expand Down Expand Up @@ -200,7 +206,13 @@ def search(self, text, index=0, match_case=False, match_whole_word=False):


class PdfTextSearcher:
""" Text searcher helper class. """
"""
Text searcher helper class.
Note:
* The :attr:`.raw` attribute stores the underlying :class:`FPDF_SCHHANDLE` object.
* The :attr:`.textpage` attribute stores the :class:`.PdfTextPage` this searcher belongs to.
"""

def __init__(self, search, textpage):
self.raw = search
Expand Down

0 comments on commit 1cef257

Please sign in to comment.