# How To

**URL:** https://forum.mupdf.com/c/how-to/6.md

[Latest](https://forum.mupdf.com/latest.md) · [Categories](https://forum.mupdf.com/categories.md) · [Tags](https://forum.mupdf.com/tags.md)

---

## [About the How To category](https://forum.mupdf.com/t/about-the-how-to-category/22)

<div class="topic-metadata">

**Author:** [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Replies:** 0\
**Last updated:** [June 12, 2025, 1:54pm UTC](https://forum.mupdf.com/t/about-the-how-to-category/22 "2025-06-12T13:54:34Z")

</div>

How to do things with MuPDF - Common Issues & Solutions. Share your top tips on how you get things done.

---

## [How to pass a ref's "gen" in \`mutool show\`](https://forum.mupdf.com/t/how-to-pass-a-refs-gen-in-mutool-show/359)

<div class="topic-metadata">

**Author:** [@Ojas\_Maheshwari](https://forum.mupdf.com/u/Ojas_Maheshwari)\
**Replies:** 1\
**Last updated:** [July 29, 2026, 12:31pm UTC](https://forum.mupdf.com/t/how-to-pass-a-refs-gen-in-mutool-show/359 "2026-07-29T12:31:15Z")

</div>

I use the mutool show command to print a PDF object by passing it’s ref. For eg, if I want to print the object with ref 176 0, I do: mutool show test.pdf 176 But what if I want to view 176 5 mutool show test.pdf 176 …

---

## [Possible to get dual view in landscape mode and darkmode?](https://forum.mupdf.com/t/possible-to-get-dual-view-in-landscape-mode-and-darkmode/358)

<div class="topic-metadata">

**Author:** [@Saint.77](https://forum.mupdf.com/u/Saint.77)\
**Replies:** 1\
**Last updated:** [July 29, 2026, 11:53am UTC](https://forum.mupdf.com/t/possible-to-get-dual-view-in-landscape-mode-and-darkmode/358 "2026-07-29T11:53:02Z")

</div>

Keep MuPDF as light and blazing fast as its now, this software is #1 for a fast PDF viewer and for that its perfect now as it is, but i have 2 ideas it could have if you should add something to it: if you flip your phone…

---

## [MuPDF viewer 1.26.8a lower page switch line is too low, cannot be operated](https://forum.mupdf.com/t/mupdf-viewer-1-26-8a-lower-page-switch-line-is-too-low-cannot-be-operated/165)

<div class="topic-metadata">

**Author:** [@Lisamarie](https://forum.mupdf.com/u/Lisamarie)\
**Replies:** 7\
**Last updated:** [January 17, 2026, 8:17am UTC](https://forum.mupdf.com/t/mupdf-viewer-1-26-8a-lower-page-switch-line-is-too-low-cannot-be-operated/165 "2026-01-17T08:17:24Z")

</div>

Hello everyone, I have a question regarding the usability of MuPDF viewer 1.26.8a. I cannot quickly switch between pages in any open PDF because the bottom line is not operable on the Galaxy S24 Ultra. I must mention …

---

## [Mupdf-ios-viewer](https://forum.mupdf.com/t/mupdf-ios-viewer/266)

<div class="topic-metadata">

**Author:** [@sabotage7351](https://forum.mupdf.com/u/sabotage7351)\
**Replies:** 1\
**Last updated:** [January 15, 2026, 1:43pm UTC](https://forum.mupdf.com/t/mupdf-ios-viewer/266 "2026-01-15T13:43:00Z")

</div>

Why is this app dead on github (since 2016), while mupdf-android-viewer is active?

---

## [MuPDF.js - 1.26.4](https://forum.mupdf.com/t/mupdf-js-1-26-4/239)

<div class="topic-metadata">

**Author:** [@pedrogil](https://forum.mupdf.com/u/pedrogil)\
**Replies:** 5\
**Last updated:** [January 7, 2026, 3:54pm UTC](https://forum.mupdf.com/t/mupdf-js-1-26-4/239 "2026-01-07T15:54:44Z")

</div>

Hello, I would like to ask about the status of MuPDF.js. Are there any plans to update it to align with the latest MuPDF release (version 1.27.0)? If so, could you share an approximate timeline or roadmap? Thank yo…

---

## [PDF File Size Reduction](https://forum.mupdf.com/t/pdf-file-size-reduction/28)

<div class="topic-metadata">

**Author:** [@HaraldLieder](https://forum.mupdf.com/u/HaraldLieder)\
**Replies:** 2\
**Last updated:** [November 8, 2025, 11:16am UTC](https://forum.mupdf.com/t/pdf-file-size-reduction/28 "2025-11-08T11:16:40Z")

</div>

Optimizing PDF File Size with PyMuPDF: Three Essential Techniques In today’s fast-paced workflows, bulky PDFs can become a bottleneck — slowing down email attachments, consuming valuable storage, and frustrating mobile …

---

## [How to get text from layers (ocg)](https://forum.mupdf.com/t/how-to-get-text-from-layers-ocg/179)

<div class="topic-metadata">

**Author:** [@Linas](https://forum.mupdf.com/u/Linas)\
**Replies:** 5\
**Last updated:** [October 11, 2025, 3:24pm UTC](https://forum.mupdf.com/t/how-to-get-text-from-layers-ocg/179 "2025-10-11T15:24:20Z")

</div>

I create pdf with text blocs associated with one layer (QMARK). So printing layers I see it ocgs = doc.get\_ocgs() for xref in ocgs: obj = doc.xref\_object(xref) print (“obj:”, obj, xref) obj: \<\< /Type /OCG /N…

---

## [PyMuPDF and using custom TrueType font](https://forum.mupdf.com/t/pymupdf-and-using-custom-truetype-font/168)

<div class="topic-metadata">

**Author:** [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Replies:** 2\
**Last updated:** [September 24, 2025, 3:07pm UTC](https://forum.mupdf.com/t/pymupdf-and-using-custom-truetype-font/168 "2025-09-24T15:07:57Z")

</div>

Hello @HaraldLieder ! I’m trying to use a TTF font file to render some text as follows: import pymupdf doc = pymupdf.open() n = doc.insert\_page(-1) page = doc\[0\] pontano = pymupdf.Font(fontname="Pontano Sans Regular",…

---

## [Filling radio buttons in form](https://forum.mupdf.com/t/filling-radio-buttons-in-form/142)

<div class="topic-metadata">

**Author:** [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Replies:** 2\
**Last updated:** [September 4, 2025, 9:01pm UTC](https://forum.mupdf.com/t/filling-radio-buttons-in-form/142 "2025-09-04T21:01:03Z")

</div>

I’m trying the following with the attached PDF: import pymupdf # Load the PDF doc = pymupdf.open("form.pdf") # Read data from CSV into a Python dictionary data = {"Name":"An Alien", "Address":"The Moon", "RadioGroup"…

---

## [The coordinate rendering from the parsed graphics does not match](https://forum.mupdf.com/t/the-coordinate-rendering-from-the-parsed-graphics-does-not-match/107)

<div class="topic-metadata">

**Author:** [@Valentine\_Chernykh](https://forum.mupdf.com/u/Valentine_Chernykh)\
**Replies:** 1\
**Last updated:** [August 4, 2025, 1:57pm UTC](https://forum.mupdf.com/t/the-coordinate-rendering-from-the-parsed-graphics-does-not-match/107 "2025-08-04T13:57:43Z")

</div>

I take the coordinates using \`.get\_drawing()\`, get the coordinates, and use them to draw exactly the same graph. I normalize the data and draw it through another library, reportlib (the problem is not on the reportlib si…

---

## [Convert a JSON file to a PDF](https://forum.mupdf.com/t/convert-a-json-file-to-a-pdf/76)

<div class="topic-metadata">

**Author:** [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Replies:** 0\
**Last updated:** [July 22, 2025, 1:52pm UTC](https://forum.mupdf.com/t/convert-a-json-file-to-a-pdf/76 "2025-07-22T13:52:32Z")

</div>

Just a quick “did you know?” JSON files can not only be loaded to extract the text content with Page.get\_text(), but also faithfully rendered with any indentation, just do: import pymupdf doc = pymupdf.open("my\_data.js…

---

## [fitz.Page.find\_tables() misses last column when using horizontal\_strategy="text"\`](https://forum.mupdf.com/t/fitz-page-find-tables-misses-last-column-when-using-horizontal-strategy-text/57)

<div class="topic-metadata">

**Author:** [@Ana\_Guedes](https://forum.mupdf.com/u/Ana_Guedes)\
**Replies:** 10\
**Last updated:** [July 21, 2025, 10:17am UTC](https://forum.mupdf.com/t/fitz-page-find-tables-misses-last-column-when-using-horizontal-strategy-text/57 "2025-07-21T10:17:34Z")

</div>

Hi! I’m using fitz.Page.find\_tables() with horizontal\_strategy="text" and vertical\_strategy="lines" while explicitly passing vertical\_lines. However, the last column is consistently missing from the extracted table, even…

---

## [How to fix code=4: no font file for digest?](https://forum.mupdf.com/t/how-to-fix-code-4-no-font-file-for-digest/41)

<div class="topic-metadata">

**Author:** [@eamag](https://forum.mupdf.com/u/eamag)\
**Replies:** 3\
**Last updated:** [June 30, 2025, 2:28pm UTC](https://forum.mupdf.com/t/how-to-fix-code-4-no-font-file-for-digest/41 "2025-06-30T14:28:13Z")

</div>

I’m trying to extract text from this pdf https://openreview.net/pdf?id=g90RNzs8wX using pymupdf4llm.to\_markdown(pdf\_path), is there a way to fix a font error? Thanks!

---

## [Smart cropping of diagrams](https://forum.mupdf.com/t/smart-cropping-of-diagrams/37)

<div class="topic-metadata">

**Author:** [@DSP\_huzi](https://forum.mupdf.com/u/DSP_huzi)\
**Replies:** 8\
**Last updated:** [June 26, 2025, 9:27pm UTC](https://forum.mupdf.com/t/smart-cropping-of-diagrams/37 "2025-06-26T21:27:43Z")

</div>

:brain: What I’m Trying to Do I’m working on a system to automatically extract diagram images from past paper PDFs. The diagrams are usually referenced like “Fig. 1.1”, and I want to extract the figure image below that l…

---

## [Watermarking PDFs](https://forum.mupdf.com/t/watermarking-pdfs/24)

<div class="topic-metadata">

**Author:** [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Replies:** 3\
**Last updated:** [June 13, 2025, 2:05pm UTC](https://forum.mupdf.com/t/watermarking-pdfs/24 "2025-06-13T14:05:09Z")

</div>

Thought I’d open up a discussion on the techniques to add watermarks. We have text based watermarks and image based, I generally use something like this to add the watermark to each page of a document: import pymupdf d…
