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

[Dummy] Update Docs #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[Dummy] Update Docs #113

wants to merge 1 commit into from

Conversation

padmkris123
Copy link

Based on our conversation about adding images in Adobe Express Add-ons, here's a comprehensive guide on using the Image APIs:

Key Features

  1. Basic Image Import: Use addImage() method from addOnUISdk.app.document to add images
  2. Multiple Sources: Support for both remote and local image sources
  3. Animated Images: Special support for animated GIFs via addAnimatedImage()
  4. Media Attributes: Optional configuration for image properties

Example Code

import { addOnUISdk } from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";

// Example: Adding an image from a URL
const imageUrl = "https://example.com/image.jpg";
const response = await fetch(imageUrl);
const blob = await response.blob();
await addOnUISdk.app.document.addImage(blob);

// Example: Adding an animated GIF
const gifUrl = "https://example.com/animation.gif";
const gifResponse = await fetch(gifUrl);
const gifBlob = await gifResponse.blob();
await addOnUISdk.app.document.addAnimatedImage(gifBlob);

Important Notes

  1. Images must be provided as Blob objects
  2. Supported formats include PNG, JPEG, and GIF
  3. Error handling is recommended for network requests
  4. Consider image size and format limitations
  5. Use MediaAttributes for advanced configuration

Referenced Files

This PR references the following files:

  • src/pages/guides/develop/how_to/use_images.md
  • src/pages/references/addonsdk/app-document.md

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

Successfully merging this pull request may close these issues.

1 participant