Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,452
Community Members
 
Community Events
165
Community Groups

create macro for pdf resize

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")

image.png

1 answer

hii @Soumyadeep Mandal - SaM ,

i cant use "pdf macro" as it showing horizontal scrollbar , we dont want scroll  bar 

image.png

Like Soumyadeep Mandal - SaM likes this

Hi @Sneha Gole ,

Add "overflow-x: hidden;" to the style and check!

Regards,

Soumyadeep

Like Hina Khan likes this

hii, @Soumyadeep Mandal - SaM 

i have tried this before " overflow-x: hidden " will hide scroll bar but it doesn't show pdf in full size .  

Like Soumyadeep Mandal - SaM likes this

Hi @Sneha Gole ,

change the width to 100%

<div style="width: 100%; height: 600px">

else

You can contact HERE

Regards,

Soumyadeep

Like Hina Khan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

38 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you