Skip to content

Commit 1726be5

Browse files
committed
Fix several typos in the code snippets in the documentation
1 parent 5bc31ae commit 1726be5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

docs/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,12 +1952,12 @@ If it is *False* or if you want to be on the safe side, pick one of the followin
19521952

19531953
* **Prepend** the missing stacking command by executing *fitz.TOOLS._insert_contents(page, b"q\n", False)*.
19541954
* **Append** an unstacking command by executing *fitz.TOOLS._insert_contents(page, b"\nQ", True)*.
1955-
* Alternatively, just use :meth:`Page._wrapContents`, which executes the previous two functions.
1955+
* Alternatively, just use :meth:`Page.wrap_contents`, which executes the previous two functions.
19561956

19571957
.. note:: If small incremental update deltas are a concern, this approach is the most effective. Other contents objects are not touched. The utility method creates two new PDF :data:`stream` objects and inserts them before, resp. after the page's other :data:`contents`. We therefore recommend the following snippet to get this situation under control:
19581958

19591959
>>> if not page._isWrapped:
1960-
page._wrapContents()
1960+
page.wrap_contents()
19611961
>>> # start inserting text, images or annotations here
19621962

19631963
--------------------------

docs/functions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Yet others are handy, general-purpose utilities.
2020
:meth:`ConversionTrailer` return trailer string for *getText* methods
2121
:meth:`Document.del_xml_metadata` PDF only: remove XML metadata
2222
:meth:`Document.set_xml_metadata` PDF only: remove XML metadata
23-
:meth:`Document.delete_object` PDF only: delete an object
23+
:meth:`Document._deleteObject` PDF only: delete an object
2424
:meth:`Document.get_new_xref` PDF only: create and return a new :data:`xref` entry
2525
:meth:`Document._getOLRootNumber` PDF only: return / create :data:`xref` of */Outline*
2626
:meth:`Document.pdf_catalog` PDF only: return the :data:`xref` of the catalog
@@ -346,7 +346,7 @@ Yet others are handy, general-purpose utilities.
346346

347347
-----
348348

349-
.. method:: Document.delete_object(xref)
349+
.. method:: Document._deleteObject(xref)
350350

351351
PDF only: Delete an object given by its cross reference number.
352352

@@ -521,7 +521,7 @@ Yet others are handy, general-purpose utilities.
521521

522522
PDF only: Clean and concatenate all :data:`contents` objects associated with this page. "Cleaning" includes syntactical corrections, standardizations and "pretty printing" of the contents stream. Discrepancies between :data:`contents` and :data:`resources` objects will also be corrected if sanitize is true. See :meth:`Page.getContents` for more details.
523523

524-
Changed in version 1.16.0 Annotations are no longer implicitely cleaned by this method. Use :meth:`Annot._cleanContents` separately.
524+
Changed in version 1.16.0 Annotations are no longer implicitely cleaned by this method. Use :meth:`Annot.cleanContents` separately.
525525

526526
:arg bool sanitize: *(new in v1.17.6)* if true, synchronization between resources and their actual use in the contents object is snychronized. For example, if a font is not actually used for any text of the page, then it will be deleted from the ``/Resources/Font`` object.
527527

docs/page.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ In a nutshell, this is what you can do with PyMuPDF:
9696
:meth:`Page.showPDFpage` PDF only: display PDF page image
9797
:meth:`Page.updateLink` PDF only: modify a link
9898
:meth:`Page.widgets` return a generator over the fields on the page
99-
:meth:`Page.writeText` write one or more :ref:`Textwriter` objects
99+
:meth:`Page.writeText` write one or more :ref:`TextWriter` objects
100100
:attr:`Page.CropBox` the page's :data:`CropBox`
101101
:attr:`Page.CropBoxPosition` displacement of the :data:`CropBox`
102102
:attr:`Page.firstAnnot` first :ref:`Annot` on the page
@@ -472,7 +472,7 @@ In a nutshell, this is what you can do with PyMuPDF:
472472

473473
*(New in version 1.16.18)*
474474

475-
PDF only: Write the text of one or more :ref:`Textwriter` ojects to the page.
475+
PDF only: Write the text of one or more :ref:`TextWriter` ojects to the page.
476476

477477
:arg rect_like rect: where to place the text. If omitted, the rectangle union of the text writers is used.
478478
:arg sequence writers: a non-empty tuple / list of :ref:`TextWriter` objects or a single :ref:`TextWriter`.

docs/rect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Hence some useful classification:
3333
:meth:`Rect.morph` transform with a point and a matrix
3434
:meth:`Rect.norm` the Euclidean norm
3535
:meth:`Rect.normalize` makes a rectangle finite
36-
:meth:`Rect.round` create smallest :ref:`Irect` containing rectangle
36+
:meth:`Rect.round` create smallest :ref:`IRect` containing rectangle
3737
:meth:`Rect.transform` transform rectangle with a matrix
3838
:attr:`Rect.bottom_left` bottom left point, synonym *bl*
3939
:attr:`Rect.bottom_right` bottom right point, synonym *br*

0 commit comments

Comments
 (0)