I want to export a block in a textDocument as an image.
龚
龚 文益
started a topic
about 2 years ago
like this.
Does myScript have a way to provide it?
Best Answer
O
Olivier @MyScript
said
about 2 years ago
Dear 龚 文益,
Thank you for contacting us.
Currently, if I understand well, you add a Math Block in a text Document and would like to export this Math Block as an image? Let me know if no.
Before calling the export functions, we recommend you call the getSupportedExportMimeTypes function on the block you want to export.
In the case of a Math block, you will see you can export as LATEX, MATHML, DOCX, HTMl AND JIIX. You cannot export as an image.
What do you exactly need? Indeed, otherwise, you can save an image as follows (of course, tune it according to your needs) ; but this will be an image of the screen, not of your block (for such purpose, tune the parameters of the invalidate function to the position of your block)
Currently, if I understand well, you add a Math Block in a text Document and would like to export this Math Block as an image? Let me know if no.
Before calling the export functions, we recommend you call the getSupportedExportMimeTypes function on the block you want to export.
In the case of a Math block, you will see you can export as LATEX, MATHML, DOCX, HTMl AND JIIX. You cannot export as an image.
What do you exactly need? Indeed, otherwise, you can save an image as follows (of course, tune it according to your needs) ; but this will be an image of the screen, not of your block (for such purpose, tune the parameters of the invalidate function to the position of your block)
龚 文益
like this.
Does myScript have a way to provide it?
Dear 龚 文益,
Thank you for contacting us.
Currently, if I understand well, you add a Math Block in a text Document and would like to export this Math Block as an image? Let me know if no.
Before calling the export functions, we recommend you call the getSupportedExportMimeTypes function on the block you want to export.
In the case of a Math block, you will see you can export as LATEX, MATHML, DOCX, HTMl AND JIIX. You cannot export as an image.
What do you exactly need? Indeed, otherwise, you can save an image as follows (of course, tune it according to your needs) ; but this will be an image of the screen, not of your block (for such purpose, tune the parameters of the invalidate function to the position of your block)
ImageDrawer drawer = new ImageDrawer();
drawer.prepareImage(100,100);
drawer.invalidate(editor.getRenderer(), 0,0, 100,100, EnumSet.allOf(IRenderTarget.LayerType.class));
drawer.saveImage("myImage");
Please let us know if this helps.
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstOlivier @MyScript
Dear 龚 文益,
Thank you for contacting us.
Currently, if I understand well, you add a Math Block in a text Document and would like to export this Math Block as an image? Let me know if no.
Before calling the export functions, we recommend you call the getSupportedExportMimeTypes function on the block you want to export.
In the case of a Math block, you will see you can export as LATEX, MATHML, DOCX, HTMl AND JIIX. You cannot export as an image.
What do you exactly need? Indeed, otherwise, you can save an image as follows (of course, tune it according to your needs) ; but this will be an image of the screen, not of your block (for such purpose, tune the parameters of the invalidate function to the position of your block)
ImageDrawer drawer = new ImageDrawer();
drawer.prepareImage(100,100);
drawer.invalidate(editor.getRenderer(), 0,0, 100,100, EnumSet.allOf(IRenderTarget.LayerType.class));
drawer.saveImage("myImage");
Please let us know if this helps.
Best regards,
Olivier
龚 文益
Thank you for your help, this is the customer's needs, I can't know what function to use, I will try it according to your prompt, thank you
Olivier @MyScript
Dear 龚 文益,
Thank you for the update.
Feel free to contact us if you have any question.
Best regards,
Olivier