sys PDF Viewer

Files that you want to work with locally (which I mean files that are local on the Servoy server, or your developer when testing), should really be located in (or moved to at runtime) plugins.file.getDefaultUploadLocation(). Which is something like C:\users{username}.servoy\uploads{guid}\

Personally, I’d put them in a subfolder, like “templates” or something, so its at C:\users{username}.servoy\uploads{guid\templates\test.pdf

That default upload location path can also be set at http://localhost:8080/servoy-admin/plugin-settings as servoy.FileServerService.defaultFolder setting.

Then, in your code you can do something like this:

var file = plugins.file.convertToRemoteJSFile("/templates/test.pdf");
var url = plugins.file.getUrlForRemoteFile(file);
pdfForm.elements.pdf_Viewer.documentURL = url;