Skip to main content
Participant
October 4, 2022
Question

Using Images with Document Generation API

  • October 4, 2022
  • 1 reply
  • 428 views

Hi there,

 

I'm trying to dynamically insert images into a document in a repeating section. For some reason this isn't working for me at all and I was hoping I could get some help. I've tried using the image urls as well as base 64 encoding.

 

My document has the following:

 

{% repeating-section backup[number > 0] %}

 

 

{{name}}

{% end-section %}

 

With the alt text of the image:
{
"location-path": "path",
"image-props": {
"alt-text": "Backup Load"
}
}

 

And the json is as follows:

{
  "paymentType""cash",
  "client": {
    "name""Jade",
    "address""Placeholder Address"
  },
  "recommendation": {
    "label""7.1 kWp Solar Panels + 7kWh Storage",
    "outputkWhYearOne""56,739",
    "priceInclVATR""250,000",
    "firstYearSavings""20,123"
  },
  "backup":[
    {"name":"Electric Fence""number"1"path""https://media.umbraco.io/mangrove/iopbdhw4/electric_fence.svg"},
    {"name":"CCTV""number"6"path""https://media.umbraco.io/mangrove/v5eif5al/cctv.svg"},
    {"name":"LED Lights""number"0"path""https://media.umbraco.io/mangrove/r31jgjzg/led_lights.svg"}
]
}
This topic has been closed for replies.

1 reply

Raymond Camden
Community Manager
Community Manager
October 6, 2022

I'm not able to replicate the error. It worked as expected.Would you be ok sharing your Word doc so I can test it along with your data shown here?