web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Generate PDF - HTML Te...
Power Apps
Unanswered

Generate PDF - HTML Text Error

(1) ShareShare
ReportReport
Posted on by
I have a Canvas PowerApp I'm creating that will have one of the screens generate to a pdf as part of a monthly report. The issue that I am having is that on the screen to be printed I have a component that consists of an HTML text that is used to give the header box a gradient to match other company reports. The gradient is visible during normal app operation, but when the pdf is generated the header goes entirely black.
 
What I have in the HTML Text:
 
"<div style='width: 100%;
 height: 89px;
 background:linear-gradient(to left,#4472C4, #FFFFFF'>
 </div>"
 
The code for running the pdf generation:
 
Office365Outlook.SendEmailV2(
    User().Email,
    Gallery_MOR.Selected.Site & " " & Gallery_MOR.Selected.'MOR Month' & " " & Gallery_MOR.Selected.'MOR Year' & " MOR Report",
    "Test",
    {
        Attachments: {
            Name: Gallery_MOR.Selected.Site & " " & Gallery_MOR.Selected.'MOR Month' & " " & Gallery_MOR.Selected.'MOR Year' & " MOR Report.pdf",
            ContentBytes: PDF(ScreenDataEntry,{Orientation:"Landscape"})
        }
    }
);
 
Attached is what the screen looks like in the app and should look like in the pdf, and then also attached is what I get.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,032 Most Valuable Professional on at
    This may not be useful to you, but the PDF() function still needs improvement in the handling of a number of formats, images being another one. Power Apps in general can be a bit unforgiving with HTML rendering, particularly more complex CSS styles.
    If it is not properly rending your HTML, you may need to approach it from a different direction until you get something to work.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard