iink SDK on Device

Answered

How to set default text Block height and other block(Diagram, Drawing) size ?

When i handwriting something directly, if the drawing is more than 3 lines, the ink will be removed, seems when i write some thing it will auto create a text block before combine this text block to it's neighbor, and this text block has a max height, do i have some way to set this height ? or remove this limit ?

And when i add a block i add a block(IINKContentBlock) to editor, it only can set the origin point of it, if there have any way to setup the block size when create it? or what determines the size of the added block?


Thanks!


Best Answer

Dear Xiaming,


Currently, I am not sure to understand what you want to achieve:

-Do you want to export only the raw ink as html?

-Do you want to have the text converted?

-Do you need a "Text Document" part, or only a "Text" part ?

-...


Indeed, to answer your first-question, it is not possible to disable the guidelines while in a "Text Document". If you want to be in a Text part, then you can disable the latters with the following configuration: conf.setBoolean("text.guides.enable",false);


If you want to get the ink, you shall export before calling the "convert" function


Otherwise, you could use other parts, such as "Raw Content" or "Drawing", and export as an image: https://developer.myscript.com/docs/interactive-ink/1.3/overview/import-and-export-formats/#available-exports.

Or a Diagram and export as html.


So, the better is that you provide with your exact needs, so that we can provide with an accurate answer.


Thank you,


Best regards,


Olivier


Dear Xiaoming Jin,


thank you for contacting us and your questions. To answer these:


1-I guess you are in a "Text Document" part, and you are trying to write on several lines? Then you are facing the expected behavior, as in a Text Document, you must ensure you write on the lines.

One solution could be that you use a "Text" part instead, and de-activate the guidelines. This can be done as follows: conf.setBoolean("text.guides.enable",false);

In that case, you will be able to write "as big" as you prefer, as guidelines will be re-computed. Nevertheless, please note the height of the words shall be consistent (ensure words have basically the same height).

Nevertheless, please note a "Text" part doesn't allow to add block (it it not a container part)


2-The AddBlock function doesn't allow to set the height and width of a block, all you provide is the "approximate" position of where you want the top-left corner of your block to be, and the iink will try to put the block where it can. If there is not enough place, it will not add the block and will raise an IllegalStateException exception: https://developer.myscript.com/refguides/interactive-ink/android/1.3/com/myscript/iink/Editor.html#addBlock-float-float-java.lang.String-

Then, when adding data in your block, it will be re-sized accordingly: https://developer-support.myscript.com/en/support/discussions/topics/16000024723

Is it possible to know the reason you would like to be able to pre-define the size of a block? So that, we may provide with a more accurate answer?


Thank you,


Best regards,


Olivier

Thanks @Olivier, it make senses

How can i disable text guides on Text Document ?

I want to convert the ink to html, so i have to convert the editor first, but when i convert it, my drawing replaced by the text guides, how i can keep my drawing inks while convert it ?


Answer

Dear Xiaming,


Currently, I am not sure to understand what you want to achieve:

-Do you want to export only the raw ink as html?

-Do you want to have the text converted?

-Do you need a "Text Document" part, or only a "Text" part ?

-...


Indeed, to answer your first-question, it is not possible to disable the guidelines while in a "Text Document". If you want to be in a Text part, then you can disable the latters with the following configuration: conf.setBoolean("text.guides.enable",false);


If you want to get the ink, you shall export before calling the "convert" function


Otherwise, you could use other parts, such as "Raw Content" or "Drawing", and export as an image: https://developer.myscript.com/docs/interactive-ink/1.3/overview/import-and-export-formats/#available-exports.

Or a Diagram and export as html.


So, the better is that you provide with your exact needs, so that we can provide with an accurate answer.


Thank you,


Best regards,


Olivier

Thanks @Oliver

I need to use "Text Document" part for text and graph ,  and i want to save stokes as draft before it converted,  when i  want to preview my drawing as html, i have to convert it, at this time my strokes was replaced by text(but i want to keep my strokes)


Dear Xiaoming Jin,


I am not sure to exactly catch what you want to achieve, but did you give a try to the "raw content" part? It will allow you to extract "text" from "non text"?


Can you please provide with detailed specification of what you want to achieve, so that we may think of another way to proceed?


Best regards,


Olivier