web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Align picture in HTML ...
Power Apps
Unanswered

Align picture in HTML Code

(0) ShareShare
ReportReport
Posted on by 46

Hi Everyone!

 

I created an app using Shane Young post to create a PDF with Signature (PenInput). I added an image converted to Base64 and the PDF workd good but I need to align it to the right, I've tried all the HTML examples from various pages but can't get the result.

 

The code I have is:

 

PenInput.Run("<!DOCTYPE html>
<html>
<head>
</head>
<body size='A4'>
<img src='data&colon;image/png;base64,iVBORw0KGgoAA.....................'>

<p>Text </p>

</body>
</html>

 

This is how i get the image aligned to the left, and just need to align it to the right.

 

sebastiandcarri_0-1616604398103.png

 

Thanks

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    Just add align="right" to the attributes of the image tag.

    <body size='A4'>
    <img align="right" src='data&colon;image/png;base64,iVBORw0KGgoAA.....................'>
    
    <p>Text </p>

     

  • sebastiandcarri Profile Picture
    46 on at

    Thanks for your response. Didn't work. Added as you mention shows this error:

    sebastiandcarri_0-1616605887658.png

    Code:

    <img align="right" src='data&colon;image/png;base64,....>

     Changed to next but didn't work neither:

    <img align='right' src='data&colon;image/png;base64,...>

  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    Since you are inputting the code as a static string you'll need to escape the " character.

    <img align=\"right\" src='data&colon;image/png;base64,...>
  • sebastiandcarri Profile Picture
    46 on at

    Didn't work either 

    sebastiandcarri_0-1616613756827.png

     

  • Pstork1 Profile Picture
    69,521 Most Valuable Professional on at

    Don't you get the same error when you remove the align= code?  It looks to me like you are trying to add a multiline string in as a static string.  That's not going to work.  I don't think its the align that is causing the error.  Its the way you are inputting your html code.

  • sebastiandcarri Profile Picture
    46 on at

    No, without the align code it works fine. It embed the img base 64, adds the signature from PenInput and creates de PDF. This is part of the code with Concat function to bring the data from the list, and the JSON Input and I'm not getting any problem.

     

    PenInput.Run("<!DOCTYPE html>
    <html>
    <head>
    </head>
    <body size='A4'>
    <img src='data&colon;image/png;base64='>
    <p>XXXXXXXX,"&Concat(Gallery2.AllItems, Text(Modified,DateTimeFormat.ShortDate))&"</p>
    <p><strong>XXXXXXXX</strong></p>
    <p><strong>XXXXXXX</strong></p>
    <p><strong>a.</strong>XXXXXXXXXX (XXXX <strong>$ XXXXXX</strong>) $"&Concat(Gallery2.AllItems, Text(VInt))&", XXXXXX "&Concat(Gallery2.AllItems, Text(MInt))&" XXXXXXX"& Concat(Gallery2.AllItems, Text(If(Text(CCert)="false","No","Si"))) &"XXXXXXX</p>
    <img width='90px' src=" &JSON(PenInput1.Image, JSONFormat.IgnoreBinaryData) & ">
    <p>SAP ID: "&Concat(Gallery2.AllItems, SAPID) &"</p>
    </body>
    </html>
    ", "File"&Last(BD).Modified)

  • Prakhar_Gupta1 Profile Picture
    51 on at

    Hello @sebastiandcarri @Pstork1 

    I also tried all above this, but still, I am not able to align the image to the right side.

    Please help, if you get something...

  • Pluthard Profile Picture
    2 on at

    Hello,

     

    The following code currently works on my applications :

     

    <!--Align center-->
    <img 
     style='display: block; margin-left: auto; margin-right: auto;' 
     src='https://barcode.tec-it.com/barcode.ashx?data=Hello World'
    >
    
    <!--Align left-->
    <img 
     style='display: block; margin-right: auto;' 
     src='https://barcode.tec-it.com/barcode.ashx?data=Hello World'
    >
    
    <!--Align right-->
    <img 
     style='display: block; margin-left: auto;' 
     src='https://barcode.tec-it.com/barcode.ashx?data=Hello World'
    >

     

    Pluthard_0-1700480624424.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard