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 / Using the PDF viewer f...
Power Apps
Unanswered

Using the PDF viewer function to send the viewer as an attachment to email

(0) ShareShare
ReportReport
Posted on by 8
Hi,
 
I have built an app that has a PDF viewer of a gallery item on a screen, I would like to send an attachment on email of the item shown in the PDF viewer. This is the code I use below.
 
However it is successful and I get an email, with the attachment, but when the attachment is opened I get a black box on the page and not the item record shown in the viewer?
 
I am not sure where I am going wrong, as I have also tried the container on the home screen that also shows the item and that just provides a completley blank screen?
 
Office365Outlook.SendEmailV2(User().Email,"Arion Commissioning Tracker Record","PDF From Power Apps",{Attachments:Table({Name:"ArionCommissioningTrackerRecord.pdf",ContentBytes:PDF(PdfViewer2)})})
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at
    I don't think you can send the PDF directly as ContentBytes for the file. You need to translate it to Base64 encoded. You can do that using the JSON function.  Try the following:
     
    Office365Outlook.SendEmailV2(User().Email,"Arion Commissioning Tracker Record","PDF From Power Apps",{Attachments:Table({Name:"ArionCommissioningTrackerRecord.pdf",ContentBytes:JSON(PDF(PdfViewer2),JSONFormat.IncludeBinaryData)})})

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard