Hiện tại em đang làm 1 dự án chuyển file docx sang html, mọi thứ đều ổn nhưng mathtype thì lại không chuyển được, mọi người có cách nào để chuyển các mathtype trong file docx sang file png sử dụng javascript không ạ ?
Chuyển đổi image wmf sang png
Bạn có thể dùng package js-wmf
để render file wmf ra canvas rồi dùng method toDataUrl()
để render canvas thành file png
2 Likes
Nhưng mà em không hiểu tại sao nó lại bị lỗi " Header: Type 52695 must be 1 or 2" :((
Thử cái thư viện này vậy, có vẻ không bị lỗi
Hoặc không thì tự sửa code trong package luôn:
I think these files could be supported by updating
image_size_prepped_bytes()
to check for files that start with theMETA_PLACEABLE
signature of 0x9AC6CDD7, and then skipping ahead 22 bytes to get to the actual META_HEADER record.
3 Likes
em cảm ơn ạ, em làm được r <3