I want to create macro that resize pdf in full size according to div size (don't want scrollbar) .
To achieve this ,
i have added two parameter of type -
1)confluence-content(label-page)
2)attachment (label-name)
Macro code:--
"""
window.alert(${parameters.name})
<div style="width: 50%; height: 600px">
<iframe src="${entity.getAttachmentNamed("${parameters.name}").getAttachmentsUrlPath()}"
style="height: 100%; width: 100%; object-fit: contain">
</div>
"""
Macro Javascript code:--
AJS.toInit(function() {
AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("testmacro", ["pdf"]);
})
but it doesnt show preview like below image -(i think need to give correct "src")
