I have an image in the resources folder in AEM called 'warning_triangle.png'.
I want to include this using JavaScript.
In the temporary files folder, the image is exported to:
publish\templates\dita-templates\pdf\PRESET_NAME\warning_triangle.png
The JavaScript runs on ‘mergedHTML.htm’ which exists at the same level as the publish folder,
The only way I can access the image is to give the path to it but this will change dependent on the preset name.
If I use:
var hazardImage = 'warning_triangle.png';
the image is not displayed in the resultant PDF. However if I use:
var hazardImage = 'publish\templates\dita-templates\pdf\PRESET_NAME\warning_triangle.png';
Is there a more standard way of accessing files in the resource folder without having to specify a path that includes the preset name and will vary?
Alternatively, is there a way to access the preset name in the JavaScript so I can dynamically alter the publish path to include the current preset name?