pymupdf / PyMuPDF-Utilities

Demos, examples and utilities using PyMuPDF
GNU Affero General Public License v3.0
566 stars 153 forks source link

export-toc script outputs invalid csv when bookmark entry has newline character #103

Closed user202729 closed 1 year ago

user202729 commented 1 year ago

This script: https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/examples/export-toc/export.py.

Any opinion what to do in this case? (maybe just use proper csv.writer will fix the issue?)

The byte appears as a ^M (CR character) in the generated text file.

(I suspect similar issue happen when there's quote character etc. in the bookmark title as well)