Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

Suggest an answer

Log in or Sign up to answer
2 votes
Soumyadeep Mandal - SaM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 11, 2021

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
Soumyadeep Mandal - SaM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 12, 2021

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
Soumyadeep Mandal - SaM
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 12, 2021

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
TAGS
AUG Leaders

Atlassian Community Events