cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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.

@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

 

Super User III
Super User III

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (11,856)