cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

HTML Text to pdf conversion issue

Hi All,

i am trying to convert my html text to pdf however, I am stuck with one issue. I have the table formatted in the correct format, however the text in the column does not wrap itself. So I cannot fully see the text.
Can someone help me out in this issue. Please find the screenshot of the output I get.

Jayant2_2-1606115247356.png

Cheers!

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

OneDrive doesn't seem to support overflow-wrap, word-break or word-wrap... obviously this issue is simply breaking large words... are you really likely to have a single word longer than half a side of A4? If so, I suggest adding some spacing into the string (or a <br> tag)... that would work around the OneDrive limitation

View solution in original post

12 REPLIES 12
Jay-Encodian
Community Champion
Community Champion

Hey @Anonymous 

Can you share your HTML please?

Anonymous
Not applicable

"<!DOCTYPE html>
<html>
<head>
<style>
table{
 width:100%;
 table-layout:fixed;
 border-collapse: collapse;
 border: 1px solid black;
 padding:5px;
 
  }
th, td{
 border: 1px solid black;
 padding:3px;
 font-size:10px;
  overflow:hidden;
}
p{
text-align: right;
}
</style>
</head>
<body>


<table>
  <tr>
    <th colspan=2><b>From</b></th>
  </tr>
  <tr>
    <td>Shri/Smt.</td>
    <td>" & ThisItem.Title & "</td>
  </tr>
  <tr>
    <td>Address</td>
    <td>" & ThisItem.Address & "</td>
    
  </tr>
  <tr>
    <td>PAN No. or any other identifier authorized by law where PAN is not available</td>
    <td>" & ThisItem.'PAN Number' & "</td>
    
  </tr>
  <tr>
    <td>Personal E-mail id</td>
    <td>" & ThisItem.'Personal E-mail id' & "</td>
    
  </tr>
  <tr>
    <td>*Designation</td>
    <td>" & ThisItem.Designation & "</td>
    
  </tr>
  <tr>
    <td>*Employee Code</td>
    <td>" & ThisItem.'Employee Code' & "</td>
  </tr>
  <tr>
    <td>Mobile Number</td>
    <td>" & ThisItem.'Mobile Number' & "</td>
  </tr>
   <tr>
    <td>Name & address of the educational institutions of  Graduation and above (including  institutions  of  PG/  Professional/Diploma, etc.)@ </td>
    <td>" & ThisItem.'Name & address of the educational institutions of  Graduation and above (including  institutions  of  PG/  Professional/Diploma, etc.)' & "</td>
  </tr>
<tr>
    <td>Name of all Past employers@</td>
    <td>" & If(
    IsBlank(ThisItem.'Number of Past Employers'),
    ThisItem.'Past employers',
    If(
        ThisItem.'Number of Past Employers' = "2",
        Concatenate(
            ThisItem.'Past employers',
            ";",
            ThisItem.'Past employers 2'
        ),
        If(
            ThisItem.'Number of Past Employers' = "3",
            Concatenate(
                ThisItem.'Past employers',
                ";",
                ThisItem.'Past employers 2',
                ";",
                ThisItem.'Past employers 3'
            ),
            If(
                ThisItem.'Number of Past Employers' = "4",
                Concatenate(
                    ThisItem.'Past employers',
                    ";",
                    ThisItem.'Past employers 2',
                    ";",
                    ThisItem.'Past employers 3',
                    ";",
                    ThisItem.'Past employers 4'
                ),
                If(
                    ThisItem.'Number of Past Employers' = "5",
                    Concatenate(
                        ThisItem.'Past employers',
                        ";",
                        ThisItem.'Past employers 2',
                        ";",
                        ThisItem.'Past employers 3',
                        ";",
                        ThisItem.'Past employers 4',
                        ";",
                        ThisItem.'Past employers 5'
                    ),
                    If(
                        ThisItem.'Number of Past Employers' = "6",
                        Concatenate(
                            ThisItem.'Past employers',
                            ";",
                            ThisItem.'Past employers 2',
                            ";",
                            ThisItem.'Past employers 3',
                            ";",
                            ThisItem.'Past employers 4',
                            ";",
                            ThisItem.'Past employers 5',
                            ";",
                            ThisItem.'Past employers 6'
                        ),
                        If(
                            ThisItem.'Number of Past Employers' = "7",
                            Concatenate(
                                ThisItem.'Past employers',
                                ";",
                                ThisItem.'Past employers 2',
                                ";",
                                ThisItem.'Past employers 3',
                                ";",
                                ThisItem.'Past employers 4',
                                ";",
                                ThisItem.'Past employers 5',
                                ";",
                                ThisItem.'Past employers 6',
                                ";",
                                ThisItem.'Past employers 7'
                            ),
                            If(
                                ThisItem.'Number of Past Employers' = "8",
                                Concatenate(
                                    ThisItem.'Past employers',
                                    ";",
                                    ThisItem.'Past employers 2',
                                    ";",
                                    ThisItem.'Past employers 3',
                                    ";",
                                    ThisItem.'Past employers 4',
                                    ";",
                                    ThisItem.'Past employers 5',
                                    ";",
                                    ThisItem.'Past employers 6',
                                    ";",
                                    ThisItem.'Past employers 7',
                                    ";",
                                    ThisItem.'Past employers 8'
                                ),
                                If(
                                    ThisItem.'Number of Past Employers' = "9",
                                    Concatenate(
                                        ThisItem.'Past employers',
                                        ";",
                                        ThisItem.'Past employers 2',
                                        ";",
                                        ThisItem.'Past employers 3',
                                        ";",
                                        ThisItem.'Past employers 4',
                                        ";",
                                        ThisItem.'Past employers 5',
                                        ";",
                                        ThisItem.'Past employers 6',
                                        ";",
                                        ThisItem.'Past employers 7',
                                        ";",
                                        ThisItem.'Past employers 8',
                                        ";",
                                        ThisItem.'Past employers 9'
                                    ),
                                    If(
                                        ThisItem.'Number of Past Employers' = "10",
                                        Concatenate(
                                            ThisItem.'Past employers',
                                            ";",
                                            ThisItem.'Past employers 2',
                                            ";",
                                            ThisItem.'Past employers 3',
                                            ";",
                                            ThisItem.'Past employers 4',
                                            ";",
                                            ThisItem.'Past employers 5',
                                            ";",
                                            ThisItem.'Past employers 6',
                                            ";",
                                            ThisItem.'Past employers 7',
                                            ";",
                                            ThisItem.'Past employers 8',
                                            ";",
                                            ThisItem.'Past employers 9',
                                            ";",
                                            ThisItem.'Past employers 10'
                                        ),
                                        If(
                                            ThisItem.'Number of Past Employers' = "11",
                                            Concatenate(
                                                ThisItem.'Past employers',
                                                ";",
                                                ThisItem.'Past employers 2',
                                                ";",
                                                ThisItem.'Past employers 3',
                                                ";",
                                                ThisItem.'Past employers 4',
                                                ";",
                                                ThisItem.'Past employers 5',
                                                ";",
                                                ThisItem.'Past employers 6',
                                                ";",
                                                ThisItem.'Past employers 7',
                                                ";",
                                                ThisItem.'Past employers 8',
                                                ";",
                                                ThisItem.'Past employers 9',
                                                ";",
                                                ThisItem.'Past employers 10',
                                                ";",
                                                ThisItem.'Past employers 11'
                                            ),
                                            If(
                                                ThisItem.'Number of Past Employers' = "12",
                                                Concatenate(
                                                    ThisItem.'Past employers',
                                                    ";",
                                                    ThisItem.'Past employers 2',
                                                    ";",
                                                    ThisItem.'Past employers 3',
                                                    ";",
                                                    ThisItem.'Past employers 4',
                                                    ";",
                                                    ThisItem.'Past employers 5',
                                                    ";",
                                                    ThisItem.'Past employers 6',
                                                    ";",
                                                    ThisItem.'Past employers 7',
                                                    ";",
                                                    ThisItem.'Past employers 8',
                                                    ";",
                                                    ThisItem.'Past employers 9',
                                                    ";",
                                                    ThisItem.'Past employers 10',
                                                    ";",
                                                    ThisItem.'Past employers 11',
                                                    ";",
                                                    ThisItem.'Past employers 12'

                                                ),
                                                If(
                                                    ThisItem.'Number of Past Employers' = "13",
                                                    Concatenate(
                                                        ThisItem.'Past employers',
                                                        ";",
                                                        ThisItem.'Past employers 2',
                                                        ";",
                                                        ThisItem.'Past employers 3',
                                                        ";",
                                                        ThisItem.'Past employers 4',
                                                        ";",
                                                        ThisItem.'Past employers 5',
                                                        ";",
                                                        ThisItem.'Past employers 6',
                                                        ";",
                                                        ThisItem.'Past employers 7',
                                                        ";",
                                                        ThisItem.'Past employers 8',
                                                        ";",
                                                        ThisItem.'Past employers 9',
                                                        ";",
                                                        ThisItem.'Past employers 10',
                                                        ";",
                                                        ThisItem.'Past employers 11',
                                                        ";",
                                                        ThisItem.'Past employers 12',
                                                        ";",
                                                        ThisItem.'Past employers 13'
                                                    ),
                                                    If(
                                                        ThisItem.'Number of Past Employers' = "14",
                                                        Concatenate(
                                                            ThisItem.'Past employers',
                                                            ";",
                                                            ThisItem.'Past employers 2',
                                                            ";",
                                                            ThisItem.'Past employers 3',
                                                            ";",
                                                            ThisItem.'Past employers 4',
                                                            ";",
                                                            ThisItem.'Past employers 5',
                                                            ";",
                                                            ThisItem.'Past employers 6',
                                                            ";",
                                                            ThisItem.'Past employers 7',
                                                            ";",
                                                            ThisItem.'Past employers 8',
                                                            ";",
                                                            ThisItem.'Past employers 9',
                                                            ";",
                                                            ThisItem.'Past employers 10',
                                                            ";",
                                                            ThisItem.'Past employers 11',
                                                            ";",
                                                            ThisItem.'Past employers 12',
                                                            ";",
                                                            ThisItem.'Past employers 13',
                                                            ";",
                                                            ThisItem.'Past employers 14'
                                                        ),
                                                        If(
                                                            ThisItem.'Number of Past Employers' = "15",
                                                            Concatenate(
                                                                ThisItem.'Past employers',
                                                                ";",
                                                                ThisItem.'Past employers 2',
                                                                ";",
                                                                ThisItem.'Past employers 3',
                                                                ";",
                                                                ThisItem.'Past employers 4',
                                                                ";",
                                                                ThisItem.'Past employers 5',
                                                                ";",
                                                                ThisItem.'Past employers 6',
                                                                ";",
                                                                ThisItem.'Past employers 7',
                                                                ";",
                                                                ThisItem.'Past employers 8',
                                                                ";",
                                                                ThisItem.'Past employers 9',
                                                                ";",
                                                                ThisItem.'Past employers 10',
                                                                ";",
                                                                ThisItem.'Past employers 11',
                                                                ";",
                                                                ThisItem.'Past employers 12',
                                                                ";",
                                                                ThisItem.'Past employers 13',
                                                                ";",
                                                                ThisItem.'Past employers 14',
                                                                ";",
                                                                ThisItem.'Past employers 15'
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )
) & "</td>
  </tr>
</table>
</body>
</html>
"

Hey @Anonymous 

Can you please share the actual HTML which was provided for conversion obtained from your run history? This is the HTML before your expressions have been executed.

Anonymous
Not applicable

@Jay-Encodian sorry about that..

<!DOCTYPE html>
<html>
<head>
<style>
table{
 width:100%;
 table-layout:fixed;
 border-collapse: collapse;
 border: 1px solid black;
 padding:5px;
 
  }
th, td{
 border: 1px solid black;
 padding:3px;
 font-size:10px;
  overflow:hidden;
}
p{
text-align: right;
}
</style>
</head>
<body>

<table>
  <tr>
    <th colspan=2><b>From</b></th>
  </tr>
  <tr>
    <td>Shri/Smt.</td>
    <td>Jayant</td>
  </tr>
  <tr>
    <td>Address</td>
    <td>ABCD</td>
    
  </tr>
  <tr>
    <td>PAN No. or any other identifier authorized by law where PAN is not available</td>
    <td>ABCDE1234F</td>
    
  </tr>
  <tr>
    <td>Personal E-mail id</td>
    <td>ABCD</td>
    
  </tr>
  <tr>
    <td>*Designation</td>
    <td>IT</td>
    
  </tr>
  <tr>
    <td>*Employee Code</td>
    <td>1111111</td>
  </tr>
  <tr>
    <td>Mobile Number</td>
    <td>123456789</td>
  </tr>
   <tr>
    <td>Name & address of the educational institutions of  Graduation and above (including  institutions  of  PG/  Professional/Diploma, etc.)@ </td>
    <td>ABCD</td>
  </tr>
<tr>
    <td>Name of all Past employers@</td>
    <td>ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD;ABCD</td>
  </tr>
</table>

@Anonymous 

Change your td style as follows:

th, td{
border: 1px solid black;
padding:3px;
font-size:10px;
overflow:hidden;
word-wrap:break-word;
}

HTH

Jay

Anonymous
Not applicable

@Jay-Encodian tried and it did not work.

@Anonymous 

It does work... I assume you're using the OneDrive action as I've just tested and it doesn't work. This is simply because the OneDrive action's HTML support is very limited.

Here is the HTML via a browser:

1.jpg

 and with the style added:

2.jpg

 

And the outputs comparing the OneDrive action and the Encodian action:

3.jpg

 

I'll have a play to see if there is a work around

Jay

 

@Anonymous 

OneDrive doesn't seem to support overflow-wrap, word-break or word-wrap... obviously this issue is simply breaking large words... are you really likely to have a single word longer than half a side of A4? If so, I suggest adding some spacing into the string (or a <br> tag)... that would work around the OneDrive limitation

View solution in original post

Anonymous
Not applicable

@Jay-Encodian actually it can be one of a scenario, the worst case is 15 fields getting concatenated. At that time it will be an issue if the word break does not work.
how do i get the string working in?

@Anonymous 

When you concat I would suggest you concat a space (i.e. ' ' ) or a <br> tag each time... this will add spaces into the string thus working around this issue.

Anonymous
Not applicable

@Jay-Encodian i think so rather than a space a line break would help.

@Anonymous You can could add a <br> tag if preferable

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,166)