Export File as PDF
UiPath.MicrosoftOffice365.Activities.Files.ExportAsPdf
Description
Uses the Microsoft Graph Convert content API to convert a OneDrive or SharePoint file to a PDF and save it to a local location.
Scopes
This activity requires the following scopes:
- Files.Read
OR
- Files.ReadWrite
OR
- Files.Read.All
OR
- Files.ReadWrite.All
OR
- Sites.Read.All
OR
- Sites.ReadWrite.All
Project compatibility
Windows - Legacy | Windows
Configuration
In the body of the activity
- File to export - The
DriveItemof the file of interest. This object can be retrieved using the Find Files And Folders activity. Use the output property variable from either the Find Files and Folders (First or Results) or Create Workbook (Workbook) activities. If you're using the Results output property from the Find Files and Folders activity, specify the item in the array that you want to use (e.g., myFiles(0)). - Download as file - The local path to which the converted file is saved. If left blank, the project directory is used. By default, the file is saved using the file name from OneDrive or SharePoint. If a file with the same name exists in the local path that you enter in this property, the existing file is overwritten. To rename the file (and avoid unwanted overwrites), append the new file name to the end of your local path (e.g., _"C:\UiPathProjects\ConvertExample.pdf").
note
You can save files or folders for later use in the automation using the Get File/Folder activity.
Properties panel
Common
- DisplayName - The display name of the activity in the Designer panel. This property supports
Stringvariables and string formatted values.
Input
- Check the options in the body of the activity.
Misc
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level. This field supports Boolean values.
How it works
The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.
- Complete the steps.
- Add the Microsoft Office 365 Scope activity to your project.
- Add an activity or run an external process that outputs a
DriveItemobject (e.g., Find Files And Folders). - Add the Export File as PDF activity inside the Microsoft Office 365 Scope activity.
- Enter values for the Input properties.
- Run the activity.
- Your input property values are sent to the ConvertContent API.
