To add a view function, you can get a link to a new file using file.getUrl() and present the link to the user in a dialog like
var strUrl = newFile.getUrl() var html = HtmlService.createTemplateFromFile("NewTab") html.strUrl = strUrl SpreadsheetApp.getUi().showModelessDialog(html.evaluate(), "Pdf Link")
Your HTML NewTab file will be encoded like this
<!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <a href ="<?!= strUrl ?>"> Link </a> to your PDF File </body> <script> var evLink = document.getElementsByTagName('a')[0] </script> </html>
Reference:
file.getUrl()
Dialog box
SO request when opening a new tab / link
source share