Export SharePoint Page to PDF

In this guide you’ll learn how to export a SharePoint page to PDF using the SharePoint UI. You can also automatically export SharePoint pages to PDF by following our step-by-step instructions using SharePoint Designer Workflows or Power Automate.

Export to PDF with SharePoint User Interface

The Muhimbi PDF Converter for SharePoint Online comes with a 'Web Page to PDF' facility. This allows SharePoint Online pages such as Wikis and List Items to be converted to PDF using the SharePoint User interface.

In order to convert SharePoint Online URLs, the PDF Converter will need to fetch the page first, which requires authentication. As it is not possible to automatically take the username and password from the current user, credentials will need to be specified in the workflow action or - better and more secure - entered centrally on a secure screen accessible only by administrators.

The first step is to elevate the Muhimbi App to allow links to be added to the SharePoint User Interface. Please note that to begin the elevation process you need to have Site Collection Administrator privileges.

  1. Navigate to the SharePoint Admin Center ([your tenant]-admin.sharepoint.com), and add /_layouts/15/appinv.aspx to the end of the URL to access the 'elevation screen' . Please remember to use YOUR tenant's URL.

  2. In the App Id field enter 80645d3a-62a3-4ce3-a224-ce22188d619c and click 'Lookup'.

Do not change any of the fields, only paste the following XML in the 'Permission Request XML' field.

  1. Click the 'Create' button to continue to the following screen (it may look slightly different depending on the level at which elevation is carried out):

create button

  1. Click 'Trust it' to activate the App's new privileges across the entire tenant.

  2. Enable the Muhimbi PDF Converter - Convert Web Page App feature by navigating to 'Site Contents' and clicking on Muhimbi PDF Converter for SharePoint Online.

Providing you are registered as a known user you will see a 'Features' option on the left-hand side of the screen. If this option is not displayed then please read the Troubleshooting section at the end of this article.

Click the Features Link, which displays the following screen, and then click on Activate to elevate the relevant Feature.

  1. Specify the default user credentials for converting SharePoint Online pages. For more information, please refer to SharePoint Online HTML Conversion - User credentials – Muhimbi.

specify user credentials

The original list

original list

Convert via Personal Actions

convrt via personal actions

Resulting PDF

With everything configured as above, you can navigate to a Classic View of the MS SharePoint Online page. In the Personal Actions menu (the menu that is opened when clicking on your name at the top-right corner of the screen), select the Convert Page to PDF option.

The exported PDF is automatically optimized for printing. Switch to the Screen media type in the HTML Conversion configuration screen (the same screen used for specifying the default credentials) to view PDF in the same way it is displayed in the web browser.

Export to PDF with MS SharePoint Designer Workflows

Every time a List Item is updated, or whenever a List Item's status changes to Approved, a PDF file will need to be created and archived or emailed, or any other action will need to be performed automatically.

The quickest way to automate the process of exporting SharePoint pages to PDF is by creating an MS SharePoint Designer Workflow:

  1. Install and activate the Muhimbi PDF Converter for SharePoint Online Workflow Actions. Make sure to use version 9.10 or later.

  2. Although there is no need to elevate the Muhimbi App, or enable the Muhimbi PDF Converter - Convert Web Page App Feature, it may come in handy if you do not wish to store the HTML Conversion credentials inside the workflow itself.

  3. Specify the default credentials, as well as the optional aliases, using Muhimbi's User Credentials facility.

  4. Navigate to the List and use SharePoint's List ribbon to create a workflow in MS SharePoint Designer. Check this Video Tutorial if you need further help.

  5. Give the workflow a name, set its Start Options, and design the workflow.

  6. Insert the Convert HTML to PDF workflow action and fill in the blanks.

    convert html to pdf

    • this url / html: This is the fully qualified URL to convert. In this example, we will convert the List Item. Navigate to the View Item URL for the list item, and copy the URL up to and including '?ID=''. This will result in something like https://acme.sharepoint.com/sites/somesite/Lists/some_list/DispForm.aspx?ID=. Select this URL, click the three dots (...) button, and paste the address. Place the cursor at the end of the URL and click Add or Change Lookup button. From the Field from source option, select ID to automatically insert the ID of the item that is being converted.
    • this file: Specify the location to write the PDF file to, e.g. Shared Documents/item.pdf. Naturally, you can make the file name unique by inserting the ID in the same way as described in the previous step. For details about specifying output paths, see this blog post.
    • Orientation: Page orientation of the converted file. Use Portrait or Landscape.
    • Credentials: In order to convert SharePoint Online web pages - not files, this applies to URLs only - the HTML Converter needs to authenticate during conversion. Specify credentials, or leave them empty to use the default credentials configured centrally. If one or more aliases have been configured then they can be used by specifying the alias name between curly braces in the user name field (e.g. {SomeAliasName}). The password field can be left empty in this case.
    • Authentication: Accept the default value for URLs located in SharePoint Online. For external - non-SharePoint - URLs, specify Web (for normal web-based authentication) or anonymous for sites that require no authentication.
    • Viewport: Optionally specify a virtual screen resolution to allow responsive web content to output the appropriate version (e.g. mobile or desktop version).
    • Media Type: Control if output should be optimized for Print layout (using the Print CSS Media type) or rendered exactly as displayed on the screen.
    • Conversion delay: Control the delay between initially loading the page, including JavaScript rendering, and starting the PDF Conversion process. Keep this value high, as SharePoint Online pages contain very rich content.
  7. Finish the workflow, publish it, and start it on a list item of your choice. After a few seconds, you will find a PDF rendition in the output folder.

Export SharePoint page to PDF with Power Automate & Logic Apps

Muhimbi’s PDF Converter for SharePoint Online along with Microsoft Flow actions can also support the conversion of MS SharePoint Online pages. The MS SharePoint Designer workflow created in the previous section can easily be recreated in Flow. Here are the steps to export SharePoint pages to PDF with Microsoft Flow:

  1. Create a new Flow and use the SharePoint Online trigger ‘When an item is created or modified’. Fill out the URL for the site collection and select the relevant SharePoint list from the dropdown menu.

  2. Insert Muhimbi's ‘Convert HTML to PDF’ action and fill it out as per the screenshot displayed below. Naturally, you will need to substitute the source URL, username, and password. Make sure that for SharePoint Online conversions you select Print as the Media type.

  3. Insert a Create File action to write the converted file back to SharePoint Online (or Dropbox, OneDrive, or Google Drive, or send the PDF via email).

  4. Publish the workflow and create/update a list item in the specified list. After a few seconds, the Flow will trigger and a PDF file will be generated.

publish the workflow

Have a Question?
We’re Always Happy to Help.

© Muhimbi Ltd. 2008 - 2023
This website uses cookies to ensure you get the best experience. Learn more