iink SDK on Device

Answered

How can I drop in a picture?

Im hoping to be able to add images and potentially documents to the background and as interactable/ movable objects.

Thanks in advance.


Best Answer

Dear Ethan,


it is currently possible to add images as objects using the addImage function.


Let us know if this helps!


Best regards,


Olivier


Answer

Dear Ethan,


it is currently possible to add images as objects using the addImage function.


Let us know if this helps!


Best regards,


Olivier

Dear Gonzalo,


Normally, the "file" parameter should be the path of the image file. The image can be in GIF, JPEG or PNG.


You should also ensure you provide with the corresponding MIMETYPE.


Best regards,


Olivier

Hi Olivier,

I'm having issues with it too. I'm getting this error: cannot add a new block into this block

I'm attempting to add it in aTtext Document where I've successfully been able to add other content blocks. My swift code is below.

editorViewController?.editor?.addImage(p, file: Bundle.main.resourcePath! + "/blueGradient.png", mimeType: IINKMimeType.PNG)}


Any Ideas? Thanks.

Dear Gonzalo,

Thank you for the update, I am glad it is working!

Best regards,

Olivier

Dear Gonzalo,

this error is likely to occur for 2 reasons:

-Either a block that is not a Container Block already exists where you try to add the image

-Or the empty space around the position is too small

Applying the proper transform, as shown in the other topic is likely to help. Let me know if if is not the case.


Best regards,

Olivier