I would like help to resolve the error when executing this function.
file.next is not a function error
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet_bd = ss.getSheetByName('BD');
var numRows = sheet_bd.getLastRow();
var pdf = sheet_bd.getRange(numRows, 3).getValue();
var file = pdf.slice(33, 66);
//console.log(pdf.slice(33, 66));
MailApp.sendEmail({
to: 'email@email.com',
subject: "test",
body:"Test message",
attachments: [file.next().getAs(MimeType.PDF)],
});
}