How to Create and Extract PDF Graphics - pymupdf/PyMuPDF GitHub Wiki

Creating Charts, Symbols, Fun Graphics

PyMuPDF allows creating graphics using PDF draw commands. Look here and here to let inspire you. Just a few pictures:

Extract Graphics from PDF Pages

Now (2020-09-26) it is also possible to extract PDF drawings from a PDF page. This is very different from extracting images! Images are independent files which have been embedded in a PDF.

In contrast to this, drawings are created by using elementary PDF commands for drawing a line, a rectangle or a curve and giving those items line and fill colors. Drawings do not show up in the images list page.getImageList() of a page. Instead, use page.getDrawings(); this is a list of dictionaries. Each dictionary contains the information of one drawing. For more information and a detailed description see here.