You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:arg bool full: whether to also include the referencer's :data:`xref`. If *True*, the returned items are one entry longer. Use this option if you need to know, whether the page directly references the font. In this case the last entry is 0. If the font is referenced by an `/XObject` of the page, you will find its :data:`xref` here.
930
930
931
931
:rtype: list
932
932
933
-
:returns: a list of fonts referenced by this page. Each entry looks like
933
+
:returns: a list of fonts referenced by the object definition of the page. Each entry looks like
@@ -958,7 +958,12 @@ For details on **embedded files** refer to Appendix 3.
958
958
959
959
.. note::
960
960
* This list has no duplicate entries: the combination of :data:`xref`, *name* and *referencer* is unique.
961
-
* In general, this is a superset of the fonts actually in use by this page. The PDF creator may e.g. have specified some global list, of which each page only makes partial use.
961
+
* In general, this is a true superset of the fonts actually in use by this page. The PDF creator may e.g. have specified some global list, of which each page make only partial use.
962
+
* Be aware that font names returned by some variants of :meth:`Page.get_text` (respectively :ref:`TextPage` methods) need not (exactly) equal the base font name shown here. Reasons for any differences include:
963
+
964
+
- This method always shows any subset prefixes (the pattern ``ABCDEF+``), whereas text extractions do not do this by default.
965
+
- Text extractions use the base library to access the font name, which has a length cap of 31 bytes and generally interrogates the font file binary to access the name. Method ``get_page_fonts()`` however looks at the PDF definition source.
966
+
- Text extractions work for all supported document types in exactly the same way -- not just for PDFs. Consequently they do not contain PDF-specifics.
Copy file name to clipboardExpand all lines: docs/page.rst
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,7 @@ In a nutshell, this is what you can do with PyMuPDF:
106
106
:meth:`Page.load_widget` PDF only: load a specific field
107
107
:meth:`Page.load_links` return the first link on a page
108
108
:meth:`Page.new_shape` PDF only: create a new :ref:`Shape`
109
+
:meth:`Page.recolor` PDF only: change the colorspace of objects
109
110
:meth:`Page.remove_rotation` PDF only: set page rotation to 0
110
111
:meth:`Page.replace_image` PDF only: replace an image
111
112
:meth:`Page.search_for` search for a string
@@ -1924,6 +1925,14 @@ In a nutshell, this is what you can do with PyMuPDF:
1924
1925
1925
1926
:arg int rotate: An integer specifying the required rotation in degrees. Must be an integer multiple of 90. Values will be converted to one of 0, 90, 180, 270.
1926
1927
1928
+
.. method:: recolor(components=1)
1929
+
1930
+
PDF only: Change the colorspace components of all objects on page.
1931
+
1932
+
:arg int components: The desired count of color components. Must be one of 1, 3 or 4, which results in color space DeviceGray, DeviceRGB and DeviceCMYK respectively. The method affects text, images and vector graphics. For instance, with the default value 1, a page will be converted to gray-scale.
1933
+
1934
+
The changes made are **permanent** and cannot be reverted.
1935
+
1927
1936
.. method:: remove_rotation()
1928
1937
1929
1938
PDF only: Set page rotation to 0 while maintaining appearance and page content.
0 commit comments