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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

92 views 0 3
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