Skip to content

Instantly share code, notes, and snippets.

@baygross
Created November 24, 2018 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baygross/0e3cd87caae25186d8bfa0916361c0df to your computer and use it in GitHub Desktop.
Save baygross/0e3cd87caae25186d8bfa0916361c0df to your computer and use it in GitHub Desktop.
Google Docs - Custom Page Height
/* Set arbitary dimensions for any google doc. Useful for avoiding the soft-page-break dotted line and table breaks */
function myFunction(){
var doc = DocumentApp.openByUrl("YOUR-DOC-URL-GOES-HERE");
var body = doc.getBody();
var pointsInInch = 72;
body.setPageHeight(40 * pointsInInch); // 11 default
body.setPageWidth(8.5 * pointsInInch); // 8.5 default
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment