I tried using this code but did not work
This code is from https://stackoverflow.com/a/63664501 written by @Tanaike
function myFunction() { const fileId = "###"; // Please set the file ID. const url = "https://www.googleapis.com/drive/v3/files/" + fileId; const res = UrlFetchApp.fetch(url, { method: "patch", headers: {authorization: "Bearer " + ScriptApp.getOAuthToken()}, contentType: "application/json", payload: JSON.stringify({ writersCanShare: false, copyRequiresWriterPermission: false}), }); console.log(res.getContentText()) // DriveApp.createFile(blob) // This comment line is used for automatically detecting the scope of "https://www.googleapis.com/auth/drive" }
This disables all the features including print as well. If this is not possible can we use the google app script to print the iframe content only from a pdf file?