Converting Sheet data as a PDF file
You can create an application to convert Sheet data into a PDF file and store it in Drive, and return the PDF file's URL to the user:
In the Code.gs
file, create the doGet
function as listed here:
function doGet() { /* * This spreadsheet may not be active while this function * executes, so you cannot get access to active spreadsheet, * use open by id. * */ var ss = SpreadsheetApp.openById("[[ this spreadsheet id ]]"); var SheetData = ss.getSheetByName("Data"); var template = HtmlService .createTemplateFromFile("Template.html"); // Assign 'data' to the template object template.data = SheetData.getDataRange().getValues(); // Evaluate template object as html content var html = template.evaluate(); // Convert html content to pdf // var pdf = html.getAs("application/pdf") // .setName("Test_Data.pdf"); // Or use this code var pdf = html.getAs(MimeType.PDF).setName("Test_Data.pdf"); // Create...