UiPath Activities

The UiPath Activities Guide

Read XPS Files

The example below explains how to read an .xps file, extract the data, and provide the output in two message boxes by using Read XPS Text or Read XPS with OCR activities. You can find these activities in the UiPath.PDF.Activities package.

This is how the automation process can be built:

  1. Open Studio and create a new Process.
  2. Drag a Sequence container in the Workflow Designer.
    • Create the following variables:
Variable Name
Variable Type
Default Value

ExactString

String

-

ExtractWithOCRString

String

-

Note:

Add your .xps files to the project directory in order to be able to run the entire process from the same place.

  1. Drag a Read XPS Text activity inside the Sequence container.
    • In the Properties panel, add the expression "XPSTextDemo.xps" in the FileName field.
    • Add the value "All" in the Range field.
    • Add the variable ExactString in the Text field.
  2. Place a Message Box activity below the Read XPS Text activity.
    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Add the variable ExactString in the Text field.
    • Select the check box for the TopMost option for always having the message box displayed to the foreground.
  3. Drag a Read XPS with OCR activity below the Message Box activity.
    • In the Properties panel, add the expression "XPSOCRDemo.xps" in the FileName field.
    • Add the value 1 in the DegreeOfParallelism field.
    • Add the value "1" in the Range field.
    • Add the variable ExtractWithOCRString in the Text field.
  4. Place a Microsoft OCR engine inside the Read XPS with OCR activity.
  5. Drag a Message Box activity below the Read XPS with OCR activity.
    • Add the expression ExtractWithOCRString in the Text field.
    • In the Properties panel, select the Ok option from the Buttons drop-down list.
    • Select the check box for the TopMost option for always having the message box displayed to the foreground.
    • This is how your workflow should look:
  1. Run the process. The robot extracts the data using the specified process and provides the output in two message boxes.

Updated about a month ago


Read XPS Files


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.