Skip to main content
dominikt
Participant
February 18, 2017
Question

drag&drop file from html panel to active document

  • February 18, 2017
  • 1 reply
  • 1886 views

Hello,

Let's say I have a exemplary html panel with image:

<div id="test"><img src="test.jpg"  data-source="here is path to my locall file" id="drag_div" draggable="true" ></div>

What i'm trying to do is to allow user to drag this image form panel and drop it to active document's body as a new layer.

Refering to CEP_7.0_HTML_Extension_Cookbook:

CEP 5.2 support HTML 5 Drag and Drop. There are four types.

1.Drag and drop inside HTML extension.

2.Drag and drop between two HTML extensions

3.Drag and drop between HTML extension and itshost application.

4.Drag and drop between HTML extension and operating system(e.g. Desktop or Browser).

As I understand the third option gives me this possibility but I don't know how to use it. I wasn't even able to get any callback from photosop after dropping html element to application's body.

I appreciate any help

Regards,

Dominik

This topic has been closed for replies.

1 reply

Avenser
Participating Frequently
February 19, 2017

Hello!
I created the example to show how D&D can be realised without C++ (for Illustrator).
In the example you can try to drag: jpg, png, svg, ai, eps to documents of Illustrator.
Also, this principle can be used to download images from a server after D&D and for other actions.

GitHub - KupinFB/Adobe-HTML-Extension-Drag-and-Drop: Adobe HTML Extension - Drag and Drop example

I hope it can be useful for you.
But i didn't test this principle for Photoshop.

Sergey.

yashk90147758
Known Participant
May 9, 2018

Hi,

I am also trapped in the same issue. Your code is not working for me on Adobe Indesign,  i have aready changed necessary things in your extension.

Try to drag and drop both Image and Text from extension to active document.

Appreciate your help.