cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

HTML text to PDF - html table doesnt support long text wrap

Hi,

 

In my custom form app, I'm passing entered values to html text, and then text to flow, to convert it to pdf and send with email. 

The problem is, when user enters long text value to some field ( for example www link ), pdf breaks. Please see screens below:

 

Code for html text table (in the <table> its the same code for many <tr> so i put only one example)

"<!DOCTYPE html>
<html>
<head>
    <style>
       table {
          border-collapse: collapse;
          width:100%;
         }
     td, th {
        border: 1px solid #dddddd;
        text-align: center;
        padding: 8px;
        }
    </style>
</head>
<body>
<table>
    <tr>
        <th width=30%><center><b>XXXXXXX: </b></center></th><td width=70%><div>" & xxxxxxxDataCard.Text & "</div></td>
    </tr>
</table>
</body>
</html>
"

 

Converted pdf, If user puts long text without spaces (f.e. link - half of it is trimed on view):

readypdf.png

 

It seems that "width" annotations in html code doesnt work. 


Do you have any suggestion how to fix this ? Any help will be appreciated 

Thank you

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: HTML text to PDF - html table doesnt support long text wrap

Hi @golabem ,

Is your long text field set to Plain Text or Rich Text. The latter will certainly play havoc with HTML. If so, change to Plain Text and see if this works.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Advocate II
Advocate II

Re: HTML text to PDF - html table doesnt support long text wrap

@WarrenBelz 

 

I see it is set to plain text:

in powerapps:

2020-03-17_12-36-02.png

 

In Sharepoint column:

2020-03-17_12-36-25.png

 

Highlighted
Super User III
Super User III

Re: HTML text to PDF - html table doesnt support long text wrap

OK @golabem ,

I made my initial comment as I regularly use large Multiple Lines of Text fields (generally work site comments) in HTML that gets generated into email bodies and they work fine.

You have to ensure that your column and/or row spans allow for the potential size of these - I simply use a span of all columns and the height takes care of itself.

Once you get into the HTML world, you are a bit at the mercy of whatever renders it at the other end, particularly with column widths (which I see it your problem) You have to be very specific with these -I normally use a minimum of ten and set the column spans to suit what is going to go in them.

I have also found the PDF conversion (I assume you are using OneDrive) totally unforgiving on the smallest code error - it will render fine in Power Apps, but often different in the PDF.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,639)