cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Eclectic211
Frequent Visitor

Flow HTML to PDF Conversion not wrapping text

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']}

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Eclectic211
Frequent Visitor

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.

View solution in original post

3 REPLIES 3
leyburn19
Memorable Member
Memorable Member

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

Eclectic211
Frequent Visitor

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.

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. 
 

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,720)