Skip to content

Commit 5398fa7

Browse files
committed
Documentation: Explains document conversion with PyMuPDF Pro.
1 parent 05edf45 commit 5398fa7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/pymupdf-pro.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ Import |PyMuPDF Pro| and you can then reference **Office** documents directly, e
9696
From then on you can work with document pages just as you would do normally, but with respect to the `restrictions <PyMuPDFPro_Restrictions>`.
9797

9898

99+
Converting an **Office** document to **PDF**
100+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101+
102+
The following code snippet can convert your **Office** document to |PDF| format:
103+
104+
.. code-block:: python
105+
106+
import pymupdf.pro
107+
pymupdf.pro.unlock()
108+
109+
doc = pymupdf.open("my-office-doc.xlsx")
110+
111+
pdfdata = doc.convert_to_pdf()
112+
with open('output.pdf', 'wb') as f:
113+
f.write(pdfdata)
114+
115+
116+
99117
.. _PyMuPDFPro_Restrictions:
100118

101119
Restrictions

0 commit comments

Comments
 (0)