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 Automate / Flow HTML to PDF Conve...
Power Automate
Answered

Flow HTML to PDF Conversion not wrapping text

(0) ShareShare
ReportReport
Posted on by 21

Hello,

I have a flow that is taking a sharepoint list item, converting it to html, then to PDF to email.  Most everything works fine but the long text fields don't wrap in the PDF.

 

I'd seen a thread about issues with rich text fields so I converted one to a string and put it in the question field, with the same result.

 

If I open the HTML file they're wrapped.

 

**** Edit I noticed the / on the TD tags missing fixed that and I'm closer to working

 

Eclectic211_0-1605192040991.png

 

the PDF comes out like this

 

Eclectic211_1-1605192089987.png

 

.richText{
height:100%;
word-wrap:break-word;
}

 

 


<tr class="richText">
<td><b>Question: </b></td>
<td class="richText" colspan=4> @{variables('QuestionText')}<td>
</tr>
<tr class="richText">
<td><b>Suggested Solution: </b></td>
<td class="richText" colspan=4> @{outputs('Get_RFI')?['body/Suggested_x0020_Solution']} <td>
</tr>

<tr class="richText">
<td><b>RFI Response: </b></td>
<td class="richText" colspan=4>@{outputs('Get_RFI')?['body/RFI_x0020_Reponse']}

 

 

Categories:
  • leyburn19 Profile Picture
    2,157 on at

    Try adding word-break="break-all" after Col Span = 4

  • Verified answer
    Eclectic211 Profile Picture
    21 on at

    It turned out there was a field higher in the form that wasn't wrapping so that left side was doing wacky stuff.   Once I fixed that the issue was resolved.

  • leyburn19 Profile Picture
    2,157 on at

    I found a solution to this problem which actually gives food for other solutions.

     

    1. I Get my items from SharePoint List

    2. I use select to create  a Columns

    3. I create a Html Table from the select

    4. I add a compose with expression

     

    replace(body('Create_HTML_table_6'), '<table>', '<table border="1" padding="5">')  This puts a border around teh cells in the table
     
    5. I add another compose that reference the first compose with the expression
     
    replace(outputs('Compose_12'), '<td>', '<td style= "text-align:left; padding-left:1em; padding-right:1em; white-space: wrap">')   This left aligns my cells and word wraps if to long
     
    6. I do a create file in one drive using file contents of the second compose
     
    7 I convert the file to PDF
     
    This effectively created a table in a PDF that word wraps. 
     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard