Your Microsoft Technology Development and Consulting Experts - Operating since 2000

Location
Australia WideSydney, NSWMelbourne, VicBrisbane, QldPerth, WAAdelaide, SACanberra, ACTNorthern Rivers, NSWWollongong, NSWRichmond, VicDarwin, NT
emailconsult@officeexperts.com.au
Phone1300 102 810
Office experts logo
Contact Us

Export to PDF in Power Apps - The Best Way to Do It!

Power Apps doesn’t have a built-in “Export to PDF” button for your record data. This guide shows the method we use: save a record, let Power Automate turn it into a formatted PDF, and link the file back to the record in SharePoint.

By Marcello BrocchiUpdated 16 November 2026 · 14 min read
A Power Apps form becoming a PDFA form in a Power App is saved, a Power Automate flow runs, and a formatted PDF with a logo, heading, text, image and table is created.Issue trackerTitlePump faultDescriptionSavePower AppPower AutomatePump faultPDFSaved to SharePoint
7Flow actionsFrom trigger to a PDF linked to the record.
HTMLYour PDF templateText, tables and images from your record.
18 minVideo walkthroughWatch the whole build on YouTube.

Introduction

Exporting data to PDF from Power Apps is a common requirement in business applications. Inspection reports, job sheets, signed-off forms and customer summaries all end up as a PDF at some point. While Power Apps doesn’t have a built-in “Export to PDF” function for a saved record, we can achieve this functionality by combining Power Apps with Power Automate (Flow) to create professional-looking PDF exports of your app data.

In this guide, I’ll show you a streamlined approach to PDF exports, including how to:

  • Set up a Flow triggered when a record is saved in SharePoint
  • Create HTML content dynamically based on your record data
  • Include images in your PDF exports (the tricky part!)
  • Convert the HTML to a PDF file
  • Link the PDF back to your original record

Along the way you’ll also find a decision aid to check this is the right method for you, a tip for each step, a list of common mistakes and a short checklist to run before you go live.

Prefer to Watch the Video?

Head over to my YouTube channel Chino Does Stuff to watch the video tutorial. There you will see a variety of videos with loads of tricks and tips on the entire Power Platform suite.

Why Power Apps needs Power Automate

Power Apps is excellent at capturing data. A PDF is a different kind of thing: a document with a fixed layout, page breaks and images. Building that from a canvas screen is awkward, but Power Automate is made for exactly this kind of job. It can take the saved record, merge it into a template, create a file and store it where your app can find it.

The pattern in this guide is simple: a record is saved, a flow builds an HTML version of it, the HTML is converted to PDF and the PDF is saved back to SharePoint.

Data stays in one place

The PDF is built from the saved record, so the document always matches what is stored in SharePoint.

It runs in the background

The flow runs in the cloud once the record is saved, so users can carry on working in the app.

The template is just HTML

Change the layout with ordinary web skills. No special report designer is needed.

What this method can and can’t do

It helps to know where the method shines and where another approach may serve you better.

Works well for

  • Record-based documents such as issue reports, job sheets and inspection summaries
  • Layouts made of headings, text, tables and one or two images
  • PDFs stored next to the record in SharePoint, ready to open from your app
  • Automatic creation as soon as a record is saved

Less suited to

  • Pixel-perfect branded layouts with repeating headers and footers on every page
  • Long, data-heavy reports that run to many pages (a paginated report suits these better)
  • PDFs needed the instant a user taps a button. The file appears once the flow finishes, which can take a little while
  • Heavy design work such as complex multi-column layouts

Which PDF method should you use?

There isn’t one right way to make a PDF from Power Apps. Answer the questions below to see which route suits your document.

Which PDF method should you use?A decision tree. If the PDF is built from one saved record and you do not need page headers, footers or strict branding, use the HTML to PDF flow in this guide. If you do need them, use a Word template flow. If the PDF is not built from one record, use the Power Apps PDF function when a copy of the screen is enough, otherwise a paginated report.Is the PDF built fromone saved record?Need page headers, footersor strict branding?Is a copy of the screenenough for your users?YesNoNoYesYesNoRecommendedHTML to PDF flowThis guide’s methodMore controlWord templateHeaders and footersQuick capturePDF functionScreen as a PDFHeavy reportingPaginated reportLong, data-heavy
Which PDF method should you use? Start at the top and follow the answers.

If you ended up on the HTML to PDF flow, the rest of this guide is for you. Here is how the four routes compare side by side.

Comparison of four ways to create a PDF from Power Apps
MethodBest forLayout controlSetup effortLicence note
HTML to PDF flow (this guide)Record-based documents with text, tables and imagesGood. Anything HTML and simple CSS can doLow to mediumUses the SharePoint and OneDrive connectors. Confirm against your licence.
Word template flowDocuments that need headers, footers and strict brandingHigh. Word controls the layoutMediumDepends on which Word actions you use. Check whether any are premium.
Power Apps PDF functionA quick copy of what is on screenFollows the screen layoutLowBuilt into Power Apps. Check current limits on Microsoft Learn.
Paginated reportLong, data-heavy reports with page breaksHighHighUsually needs Power BI Premium or Fabric capacity. Confirm before planning.

The Sample Scenario

For this tutorial, we’ll use a simple “Issues Tracker” Power App that logs issues to a SharePoint list. When a new issue is created, our Flow will automatically generate a PDF export of that issue and attach it to the SharePoint item.

The SharePoint list contains basic fields for our issue tracking:

Fields in the Issues list and how the flow uses them
ColumnTypeUsed for
TitleSingle line of textThe PDF heading and file name
DescriptionMultiple lines of textThe body text of the PDF
IDNumber (automatic)Links the PDF back to the item
Created ByPersonOptional extra for the PDF

Your own list will have more columns. Start with these and add the rest once the basic flow works.

Building the Power Automate Flow

Let’s start by creating a Flow that will handle the PDF export process. This Flow will trigger whenever a new item is created in our SharePoint list.

  1. Step 1: Create a New Cloud Flow

    Start by creating a new cloud flow in Power Automate with a SharePoint trigger:

    1. Navigate to Power Automate and select “Create” > “Cloud flow”
    2. Choose the “When an item is created” trigger for SharePoint
    3. Select your SharePoint site and the “Issues” list

    Pro tip: Name the flow something you can search for later, such as “Issues – create PDF”. It saves hunting when you have ten flows that all start with “When an item is created”.

  2. Step 2: Get an Image for Your PDF (Optional)

    If you want to include images in your PDF (like a company logo), you’ll need to retrieve that image file first:

    1. Add a “Get file content” action from SharePoint
    2. Select your SharePoint site and document library
    3. Enter the file path to your image (e.g., “logo_small.png”)

    This step retrieves the binary content of your image file, which we’ll encode into the HTML later.

    Pro tip: Keep the image small. A logo about 200 pixels wide is plenty for a document, and larger files slow the flow down. Leave the action name as “Get file content”, because the expressions in the next step refer to it.

  3. Step 3: Compose Your HTML Content

    Now, we need to create the HTML structure that will become our PDF:

    1. Add a “Compose” action to your flow
    2. In the “Inputs” field, create the HTML structure using values from your SharePoint item

    For a basic structure with just text, you could use:

    HTML
    <!-- Basic HTML structure for PDF -->
    <h1>@{triggerOutputs()?['body/Title']}</h1>
    <p>@{triggerOutputs()?['body/Description']}</p>

    The tricky part is adding an image. To include an image in your PDF, you’ll need to encode it as a base64 string directly in your HTML:

    HTML
    <!-- Image tag for PDF with base64 encoding -->
    <img src="data:@{outputs('Get_file_content')?['body/$content-type']};base64,@{outputs('Get_file_content')?['body/$content']}" style="width: 200px; margin: 20px 0;" />

    Combining these, your complete HTML might look like:

    HTML
    <!-- Complete HTML structure with image -->
    <img src="data:@{outputs('Get_file_content')?['body/$content-type']};base64,@{outputs('Get_file_content')?['body/$content']}" style="width: 200px; margin: 20px 0;" />
    <h1>@{triggerOutputs()?['body/Title']}</h1>
    <p>@{triggerOutputs()?['body/Description']}</p>

    Pro tip: Build in layers. Get the text working first, add the image second and the styling last. If something breaks, you’ll know which layer caused it.

  4. Step 4: Create a Temporary HTML File

    Before converting to PDF, we need to save our HTML as a file:

    1. Add a “Create file” action for OneDrive
    2. Select the root folder of your OneDrive (or any folder you prefer)
    3. For the file name, use a dynamic expression: concat(triggerOutputs()?['body/Title'], '.html')
    4. For the file content, use the output from your Compose step

    This creates a temporary HTML file in OneDrive, which we’ll then convert to PDF.

    Pro tip: Titles can contain characters that file names don’t allow, such as / ? : or *. If your users type free text, build the name from the item ID instead: concat('Issue-', triggerOutputs()?['body/ID'], '.html')

  5. Step 5: Convert the HTML File to PDF

    Now comes the magic step - converting our HTML to PDF:

    1. Add a “Convert file” action from OneDrive
    2. For the “File”, select the ID from the previous “Create file” step
    3. Set the target format to “PDF”

    This step handles the conversion from HTML to PDF, giving us a properly formatted document.

    Pro tip: Test your real layout early. The converter may not draw a page exactly as a web browser does, so check tables and spacing with real data before you build the rest.

  6. Step 6: Save the PDF to SharePoint

    Now that we have our PDF, let’s save it to SharePoint where our Power App can access it:

    1. Add a “Create file” action for SharePoint
    2. Select your SharePoint site and a document library (e.g., “Issues Attachments”)
    3. For the file name, use the file name from the Convert step
    4. For the file content, use the file content from the Convert step

    Pro tip: If the Convert step doesn’t offer a file name in the dynamic content list, build one yourself with concat(triggerOutputs()?['body/Title'], '.pdf'), or use the item ID version from Step 4 with a .pdf ending.

  7. Step 7: Link the PDF to Your SharePoint Item

    Finally, we need to associate this PDF with our original SharePoint item:

    1. Add an “Update file properties” action for SharePoint
    2. Select your SharePoint site and document library
    3. For the ID, use the ID from the previous “Create file” step
    4. Add a property: “ParentID” = ID from the trigger (SharePoint list item ID)

    This creates a relationship between your PDF and the SharePoint item, making it appear as an attachment.

    Pro tip: “ParentID” is a column on the document library that holds the ID of the list item the PDF belongs to. If your library doesn’t have one yet, add it (a number column suits an item ID) before you build this step.

Complete Flow Structure

Here’s a summary of the complete flow:

The full Power Automate flow, stage by stageA new item in the Issues list triggers the flow. The flow builds HTML with a base64 logo, saves it as an HTML file in OneDrive and converts it to PDF. The PDF is saved to a SharePoint library and its ParentID column points back to the original list item.SharePoint listPower AutomateOneDriveSharePoint librarybase64.htmlPDFTriggerBuild the HTMLConvertSave and linkItem created inthe Issues listLogo as base64,text from the itemCreate .html file,convert file to PDFCreate file, setParentID to item IDParentID points back to the item
The complete flow, from a new list item to a linked PDF.
Power Automate flow steps
// Power Automate Flow Steps:

1. Trigger: When an item is created in SharePoint list
   - Site: [Your SharePoint Site]
   - List: Issues

2. Get file content (for logo/image)
   - Site: [Your SharePoint Site]
   - Library: Shared Documents
   - File: logo_small.png

3. Compose HTML content
   - Combine HTML structure with dynamic content from SharePoint
   - Include image with base64 encoding

4. Create HTML file in OneDrive
   - Folder: Root
   - Filename: concat(triggerOutputs()?['body/Title'], '.html')
   - Content: Output from Compose step

5. Convert file to PDF
   - File: ID from Create HTML file step
   - Target type: PDF

6. Create file in SharePoint
   - Site: [Your SharePoint Site]
   - Library: Issues Attachments
   - Filename: [Name from convert step]
   - File content: [Content from convert step]

7. Update file properties
   - Site: [Your SharePoint Site]
   - Library: Issues Attachments
   - ID: ID from Create file step
   - ParentID: ID from trigger (SharePoint list item ID)

Testing the Solution

Once your flow is set up, it’s time to test the solution:

  1. Open your Power App and create a new issue
  2. Enter a title and description, then save the record
  3. The flow should trigger automatically
  4. After the flow completes, you should see a PDF attachment on your SharePoint item

Opening the PDF should show your formatted content, including any images you’ve included. If a run fails, open it in the flow’s run history. Power Automate shows which action stopped and what it received, which makes most problems quick to find.

Customising Your PDF Output

You can enhance your PDF output in several ways:

Add more fields

Include any field from your SharePoint item in the HTML.

  1. Open the Compose action
  2. Add the dynamic content for the field
  3. Wrap it in a label so readers know what it is
HTML (example columns)
<p><strong>Priority:</strong> @{triggerOutputs()?['body/Priority/Value']}</p>
<p><strong>Reported by:</strong> @{triggerOutputs()?['body/Author/DisplayName']}</p>

Improve styling

Add CSS to your HTML to control fonts, colours and layout.

  1. Add a style block at the top of the HTML
  2. Stick to simple rules for fonts, colours and spacing
  3. Check the PDF after each change
HTML
<style>
  body { font-family: Arial, sans-serif; color: #1a1a1a; }
  h1 { font-size: 22pt; margin-bottom: 4pt; }
  p { font-size: 11pt; line-height: 1.5; }
</style>

Add tables

Format data in tables for better readability.

  1. Use a table for any list of values
  2. Give the header row a background colour
  3. Keep columns to what fits across an A4 page
HTML (example columns)
<table style="border-collapse: collapse; width: 100%;">
  <tr>
    <th style="background: #046999; color: #fff; padding: 6px; text-align: left;">Field</th>
    <th style="background: #046999; color: #fff; padding: 6px; text-align: left;">Value</th>
  </tr>
  <tr>
    <td style="border: 1px solid #ccc; padding: 6px;">Priority</td>
    <td style="border: 1px solid #ccc; padding: 6px;">@{triggerOutputs()?['body/Priority/Value']}</td>
  </tr>
</table>

Add conditional content

Use Power Automate expressions to show or hide content based on conditions.

  1. Put an if() expression inside the HTML
  2. Test both outcomes with real records
  3. Keep long logic in its own Compose action
Expression (example column)
@{if(equals(triggerOutputs()?['body/Priority/Value'], 'High'), '<p><strong>Urgent: action within 24 hours</strong></p>', '')}

Remember that you’re essentially creating a web page that will be converted to PDF, so most HTML and CSS techniques will work. Do test anything fancy first.

Showing the PDF in your app

Because every PDF carries the ID of its item, your Power App can find the right file later. Add the document library as a data source, filter it on the ParentID column and open the result from a button. Treat this as a starting point and check the column names in your own data source.

Power Fx (example)
Launch(
  First(Filter('Issues Attachments', ParentID = ThisItem.ID)).'Link to item'
)

Key Challenges and Solutions

Including Images

The most challenging part of this solution is including images in your PDF. The key is to:

  1. Retrieve the image file using “Get file content”
  2. Encode the image as a base64 string within an HTML image tag
  3. Include the content type to ensure proper rendering

This approach works for most image types (PNG, JPEG, etc.) but be mindful of file sizes, as large images will increase processing time. The diagram below breaks the image tag into its parts.

The HTML behind the PDF, with the image tag explainedA code panel shows an image tag whose source is a data URI built from the content type and file content, a width style, then a heading and paragraph filled from the list item. An arrow leads to the PDF page those lines produce. Four numbered callouts explain each part.Compose: the HTML<imgsrc="data:;base64,"style="width: 200px; margin: 20px 0;"/><h1></h1><p></p>content-typecontentTitleDescription1234Pump faultPDF1Content typeTells the converter it is a PNG or JPEG.Use the value from Get file content.2File contentThe image data itself, as text, readyto sit inside the tag. No extra steps.3Size the imageA width stops a large logo fillingthe page. 200px is a good start.4Dynamic contentTitles and descriptions come straightfrom the item that triggered the flow.
The HTML in the Compose action, with each part of the image tag explained.

HTML Formatting

For best results with the PDF conversion:

  • Use standard HTML elements (h1, p, table, etc.)
  • Keep CSS simple and avoid complex layouts
  • Test thoroughly to ensure proper rendering

Common mistakes to avoid

These are the slips that cause most of the “it worked in testing” surprises. Each one has a quick fix.

Linking to an image instead of embedding it

InsteadEmbed the image as base64, using the content type and file content from Get file content. A web link may not resolve when the file is converted.

Leaving temporary HTML files behind

InsteadAdd a OneDrive Delete file action once the PDF is safely in SharePoint, so the temporary files don’t pile up.

Making a new PDF on every edit

InsteadUse the “When an item is created” trigger, or add a trigger condition if you also need to cover edits.

Building file names from raw titles

InsteadInclude the item ID and avoid characters that file names don’t allow, so one odd title can’t break the flow.

Using huge images and heavy CSS

InsteadResize logos before you upload them and keep the styling simple. Big files slow the run and complex CSS may not convert cleanly.

Before you go live

  • The flow triggers once per new record, not on every edit
  • The logo or image displays in the PDF
  • Special characters in a title don’t break the file name
  • A very long description still reads well across pages
  • Empty optional fields don’t leave odd gaps
  • The PDF lands in the right library
  • ParentID shows the correct item ID
  • The temporary HTML file is deleted or accounted for
  • A second person can open the PDF from the app
  • The flow owner is a person or account that will still be around next year

Need a hand with PDF exports from Power Apps?

Our Power Platform team builds Power Apps and Power Automate solutions for Australian businesses, including document generation, SharePoint integration and reporting. Tell us what you’re trying to produce and we’ll point you at the simplest route.

Frequently asked questions

Does Power Apps have a built-in Export to PDF button?

Not for exporting a formatted record. Power Apps does have a PDF function that can turn what’s on screen into a PDF, and we look at it in a separate post. For a document built from saved data, with a layout you control, a Power Automate flow is usually the more flexible option.

Do I need a premium licence to build this flow?

This method uses the SharePoint and OneDrive for Business connectors, which Microsoft has historically listed as standard. Licensing changes over time, so check each connector in your flow against your organisation’s plan before you roll it out. Premium connectors are marked as such in the flow editor.

Can users trigger the PDF from a button instead?

Yes. Instead of the SharePoint trigger, you can start the flow from the app with a Power Apps trigger and pass in the record ID. That suits cases where users decide when a PDF is needed. The remaining steps stay much the same, except the flow needs a Get item action to read the record.

Why isn’t my image showing in the PDF?

Check three things. First, open the flow run history and confirm the Get file content action returned data. Second, make sure the content type is included in the image tag. Third, check the image isn’t very large. A missing content type is a likely culprit.

Can I add page numbers, headers or footers?

A simple HTML to PDF conversion gives you limited control over page furniture such as repeating headers and footers. If you need those, look at the Word template route in the decision guide above, where Word controls the layout. Test your own layout before you commit to either approach.

Whose OneDrive holds the temporary file?

The flow uses the OneDrive connection you set up, so the temporary HTML file is created in that account’s OneDrive. Many teams use a dedicated service account so the flow doesn’t depend on one staff member. Check licensing and security rules for service accounts in your organisation first.

Conclusion

Exporting to PDF from Power Apps is straightforward once you understand the process. By leveraging Power Automate, we can create professional-looking PDF exports that include both text and images, providing a complete solution for document generation.

This approach offers several advantages:

  • Automatic PDF generation when records are created
  • Full customisation of PDF content and appearance
  • Seamless integration with SharePoint for document storage
  • Ability to include images and formatting in the PDF

With these tools, you can enhance your Power Apps solutions with professional document generation capabilities, meeting the needs of business users who require formatted outputs from their applications.

If you’d like to see more Power Platform development tutorials, please head over to the YouTube channel and leave a comment there. I actively monitor and respond to all YouTube comments!

About the author

Marcello Brocchi

Marcello Brocchi is a lead developer at Office Experts, an Australian Microsoft consultancy established in 2000, and the founder of the YouTube channel ChinoDoesStuff. If you have any questions, get in touch using the form below, or find him on LinkedIn.

Contact Us

Get in touch with our team for general enquiries and support. We're here to help with any questions you might have about our services.

Need to attach a file?

Need pricing for a specific project? Fill out our quote form and we'll provide you with a detailed estimate tailored to your needs.