This is what I use:
Set variable $$path; Value:Get (Documentspath) & file.pdf
Then set the web viewer to $$path. There is no need for data:text/html
Hmm... I just tried that and it doesn't seem to work even on the desktop machine. Here's the path that shows in my Data Viewer for $$path
/Macintosh HD SSD/Users/jonathanstars/Documents/Agreement.pdf
Ah, here's (part of) the problem with the path. /Macintosh HD SSD/Users/jonathanstars/Documents/Agreement.pdf will fail because of the spaces. But even when I substitute %20 for the spaces, $$path does not display the file in the web viewer.
You should add the "file://" protocol in front of your path.