Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT REQUEST] Downloading images directly from the code #68

Open
rdelhaise-wiiisdom opened this issue Apr 18, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@rdelhaise-wiiisdom
Copy link

Our company Wiiisdom creating an application that uses the embedding API to retrieve data from Vizzes in automation.

Unfortunately, when downloading the image we need to click on the "Download" button in the embedded Viz. This download is in the user directory. But, when the user enables the "Save as" capability in its browser configuration we are unable to retrieve the image.

Enhancement
Would be it possible to have a function directly in the embedding API to download the image?

@anyoung-tableau
Copy link

anyoung-tableau commented Apr 18, 2024

To confirm, viz.exportImageAsync() tells the browser to download the viz image. Is that what you are looking for?

https://help.tableau.com/current/api/embedding_api/en-us/docs/embedding_api_export.html#export-image-png

Or an API that returns the base64-encoded string data of the image itself?

@rdelhaise-wiiisdom
Copy link
Author

Hello,

I'm sorry for the response time I didn't receive the notification, thank you for your fast answer !!
Unfortunately, we already use this function to export the image and it raises the "Save as" popup.

After updating data on it with the embedding API, we need to retrieve a screenshot of the Viz (like filters or parameters). So if an API that returns this screenshot with the changes exists it's exactly what I'm looking for.

@anyoung-tableau
Copy link

Thank you. Let me me make sure I'm understanding correctly.

  • viz.exportImageAsync() is insufficient because some users configure their browser to prompt for the save location when the image attempts to download; and this prevents some later logic in your web app from retrieving this image from the filesystem?
  • The request is to add an API that returns the base64-encoded string data of the image itself, allowing you to retrieve the screenshot directly from the code rather than relying on the browser downloading the file?

Something like this:

const base64str = viz.getImageDataAsync();
console.log(base64str);

// data:image/png;base64,iVBOR...ErkJggg==

@rdelhaise-wiiisdom
Copy link
Author

  1. Because of the browser's dialogue, we can't save the image in any folder. Unfortunately, it's insufficient yes :/.
  2. Exactly, it would be perfect!

@Joonyeong97
Copy link

const base64str = viz.getImageDataAsync();
console.log(base64str);

// data:image/png;base64,iVBOR...ErkJggg==

I want to use this.
I really need it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants