web('xxx.pdf') works in compiled Web App, but you need to add the pdf in the "Files required for your app to run" panal by editing project (.prf) file.
In the Web App, web('xxx.pdf') will download the pdf file to the client not viewing in the Web browser. So, I would use uihtml and hyperlink (<a> tag).
After adding HTML component in the design view, adding the following startup function.
app.HTML.HTMLSource = fullfile(ctfroot, mfilename, 'test.html');
app.HTML.HTMLSource = fullfile(pwd, 'test.html');
In the test.html file, write the following.
<a href='some.pdf' target="_blank">Link</a>
Then, adding pdf and html file in the "Files required for your app to run" panel.