Skip to main content
Participant
February 23, 2019
Question

Save File Dialouge for HTML5 Extension

  • February 23, 2019
  • 2 replies
  • 958 views

Hello Community!
This is my first ever post here so please pardon me if this is not the right place to ask questions.

I am creating a CEP extension that supports HTML5. It generates pie chart by reading values from CSV. I am using devexpress library for pie chart generation. The closet demo of the chart and its controls to my extension can be seen here​.

I have created a panel type extension. I can upload a CSV from the panel, the library generates the chart pretty similar to the demo give above. Everything works great except the final step. From the chart generated in the panel, I can't save as image to my local computer. The dialogue to save the file which opens in a browser doesn't work in InDesign.

Is there any workaround or solution to this?

Thank you!

This topic has been closed for replies.

2 replies

Participant
April 4, 2019

awaisu58238643

This code block might help:

document.getElementById('files').addEventListener('change', handleFileSelect, false);

var files;

/* Helper Functions*/

function handleFileSelect(evt) {

files = evt.target.files;

    // Loop through the FileList and render image files as thumbnails.

    for (var i = 0, f; f = files; i++) {

      // Only process image files.

      if (!f.type.match('image.*')) {

        continue;

      }

      var reader = new FileReader();

      // Closure to capture the file information.

      reader.onload = (function(theFile) {

        return function(e) {

          // Render thumbnail.

        createSpanAndInsert(['<img class="thumb" src="', e.target.result,

        '" title="', escape(theFile.name), '"/>'].join(''), 'list')

        };

      })(f);

      // Read in the image file as a data URL.

      reader.readAsDataURL(f);

    }

  }

note that this example lets users choose image files.

erinferinferinf
Adobe Employee
Adobe Employee
February 25, 2019

Hi there awaisu!

Have you checked out our guide to exporting files from the host app? It's pretty thorough.

Let me know if that helps or not, I've got a few people I can ask.

Participant
February 26, 2019

Thank you for your response ErinF.

While I did check the guide, it is not something I am looking for unfortunately. I know how to export/open the save file dialogue from the host file. I am looking to open the save file dialogue from the CEP Extension Panel using maybe jQuery.

It would be great if you can ask the professionals about it
Thank you!