Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 639 Bytes

File metadata and controls

11 lines (7 loc) · 639 Bytes

ToC in JSON

ToC in JSON format is basically same as the toc parameter of fitz.Document.set_toc as PyMuPDF docs stated. Simply rewriting the python sequence and dict into json array and object respectively will do the trick.

Check out an example in Lorem Ipsum_toc.json

However, dest["to"] accepts fitz.Point object, which cannot be serialized into or deserialized from json directly. Thus if you want to use Point object in toc, you have to write it as

{"__type__": "Point", "x": 90.0, "y": 370.0}