PDF files in forms

Hi, I’m trying to build a form in which a user can select a pdf file which will then be displayed in the form. I’m using an iframe in an HTML Element Component:

The src attribute of the iframe is defined as:

This does work as long as there are no spaces in the path to the pdf file, e.g.:
/file://c:\path\abc.pdf - works
/file://c:\path\a bc.pdf - does not work

I’ve tried to properly encode the URI with the encodeURI function, but this did not help. Does anyone know how to encode the src attribute of the iframe to allow spaces? Or is there a better approach to display pdf files in the form?

Here is the form I’ve implemented so far: Test.xaml (13.2 KB)

Hi @SK1,
I might be wrong but probably this behavior is due to the escape character. Have you tried to use it for the empty space?

Not sure which escape character you are referring to. I’ve tried to replace the space with %20 but this did not work. Is UiPath using a special escape character to allow spaces in a file path?

Not sure if I’m right but for iframes from what I remember the escape character is "\" but I’m not sure if it’s applicable here.

I’ve tried replacing the whitespace with either “/” or “\”, and ecaping it with "/ " or "\ ". None of those 4 variations worked.

I see. Hmm to be honest right now I’m not sure if we should consider it as a bug or I don’t know something. Let’s add @Tamilselvan here :slight_smile: Hopefully he will help here.