Search code examples
google-apps-scriptgoogle-docsgoogle-docs-api

How to set Pageless Google Document via Script?


Recently Google added this cool feature: Pageless Docs. I would like to activate it on all my documents.

However I cannot find the Property/Method to activate it. The code should be something like:

  var files = DriveApp.getFilesByType("application/vnd.google-apps.document");

  while (files.hasNext()) {
    var file = files.next();
    var doc = DocumentApp.openByUrl(file.getUrl());
    var body = doc.getBody();
    // set documet as Pageless ¿?
    doc.saveAndClose();
  }
}

Solution

  • As other Google Documents features, like setting tab stops, setting the pageless mode programmatically to a Google Document it's not yet possible. Send a feature request though the Google Apps Script issue tracker and keep an eye to the Release Notes.

    Related