cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golabem
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
WarrenBelz
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

 

WarrenBelz
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

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.

Top Solution Authors
Top Kudoed Authors
Users online (3,410)