Hi,
I am trying to write a plugin which generate math formulas as image.
Is it possible to add the generated image file to ebook?
If yes how can I do this?
What I have tried:
Quote:
image_path = get_abspath_of_rendered_file()
with open(image_path, "rb") as imageFile:
str = base64.b64encode(imageFile.read())
self.bk.addfile("MathmMlid", "MathMLImage", str, "image/png", properties=None, fallback=None,overlay=None)
|
but nothing happens.
Quote:
image_path = get_abspath_of_rendered_file()
self.bk.addfile("MathmMlid", "MathMLImage", image_path, "image/png", properties=None, fallback=None,overlay=None)
file.close()
|
but luncher crashed.
I have already checked the image file exists.
Thank you