Forge Macro Export Function "Custom UI" Limitation

Having the code block below in your manifest enables your macro to be included in the pdf or word file when your confluence page is exported.

modules:
  macro:
    - key: xxx-xxxx-xxx
      resource: main
      resolver:
        function: resolver
      title: Macro
      description: xxxxxxx
      export:
        function: xxxxx-export
  function:
    - key: xxxxx-export
      handler: export.run
app:
  id: ari:cloud:ecosystem::app/xxxxxx-xxxx-xxxx-xxxx-xxxx

The main limitation here is that the export function provided can only be UI kit.

Now, this works okay for macros built using the UI kit. But, it becomes difficult for the export function to support sophisticated macros built using Custom UI, simply because UI kit components are limited and cannot be extended (please correct me if I am wrong here).

Luckily, UI kit provides an image component. So, an image representation of your macro can be generated and stored “somewhere” passing the image URL in the image component src.

Also, you can create a base64 image representation of your macro and then pass the string in the image component src.

However, the first approach is complex and can leave some security risks as images with sensitive data are stored externally. With the second approach, you run into the risk of " request entity too large" error when the image base64 string representation is too large.

So, I would like to ask the following questions to the Forge team:

  1. Are there currently other ways to export macros with complex UIs built using Custom UI?
  2. How do you plan to support macros with complex UI that are built with Custom UI?
  3. Is there any timeline for this?

All comments are welcomed.

Thanks.

9 Likes

We are also looking for a better macro export experience, especially for Custom UI.

3 Likes

Hello @OnucheIdoko1 ,

I’m Engin, an engineer in Confluence Ecosystem team. I’m one of the engineers who worked on the export functionality.

I’m curious how are you generating the image. How difficult is it?
An idea for storage is storing the image as an attachment in the page.

Hello @EnginTekin

We have an external service that serves images. So basically, we send the service some html and the service serves the content as png. Then the response is converted to base64: data:image/png;base64,${imageBase64} and used in the UI Kit Image src atribute.

We want to avoid storing this anywhere. Because, the job here is to include the macro when the page is exported. Also, storage does not solve the export function limitation.

HI @EnginTekin Please, any ideas on how to better achieve this?

Related: Forge Macro can not be exported as PDF

It appears the export feature is not working?

As described in the ticket (which appears to be the case for UI kit macro), it’s not working for my Custom UI macro either