dexplo / dataframe_image

A python package for embedding pandas DataFrames as images into pdf and markdown documents
https://dexplo.org/dataframe_image
MIT License
282 stars 41 forks source link

_screenshot.py的95行,有一个中文的bug #23

Closed huomqh closed 2 years ago

huomqh commented 3 years ago

当内容为中文时,在如题位置会报一个gbk的错误,需要手工改为with open(temp_html, "w",encoding='utf8') as f:才可以。 另外,由于chrome安装在win server 2019的时候,注册表读取位置是没有相应的键值的,所以也会报错,需要手动修改53行后面的内容才行。

PaleNeutron commented 2 years ago

中文默认编码问题已经修复,参见 https://github.com/dexplo/dataframe_image/commit/89c05ae8b3b65d08cef65b8e639df864f66a76a5

Chrome的路径问题可以通过手动指定 chrome_path 解决

dfi.convert('path/to/your_notebook.ipynb',
                to='pdf',
                use='latex',
                center_df=True,
                max_rows=30,
                max_cols=10,
                execute=False,
                save_notebook=False,
                limit=None,
                document_name=None,
                table_conversion='chrome'
                chrome_path=None,
                latex_command=None,
                output_dir=None,
                )